Ansible for IPA

This commit is contained in:
Florence Blanc-Renaud
2017-07-03 09:55:23 +02:00
commit 09f45e4acd
13 changed files with 814 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
---
# defaults file for ipaclient
ipaclient_domain:
ipaclient_realm:
ipaclient_server:
ipaclient_principal:
ipaclient_password:
ipaclient_keytab:
ipaclient_otp:
ipaclient_extraargs: []

View File

@@ -0,0 +1,24 @@
galaxy_info:
author: Florence Blanc-Renaud
description: A role to join a machine to an IPA domain
company: Red Hat, Inc
# issue_tracker_url: http://example.com/issue/tracker
license: GPLv3
min_ansible_version: 2.0
#github_branch:
platforms:
- name: Fedora
versions:
- 25
- name: rhel
versions:
- 7
galaxy_tags: [ 'identity', 'ipa']
dependencies: []

View File

@@ -0,0 +1,19 @@
---
# tasks file for ipaclient
- name: Install - Install IPA client package
package:
name: "{{ ipaclient_package }}"
state: present
- name: Install - Configure IPA client
ipaclient:
state: present
domain: "{{ ipaclient_domain }}"
realm: "{{ ipaclient_realm }}"
server: "{{ ipaclient_server }}"
principal: "{{ ipaclient_principal }}"
password: "{{ ipaclient_password }}"
keytab: "{{ ipaclient_keytab }}"
otp: "{{ ipaclient_otp }}"
extra_args: "{{ ipaclient_extraargs }}"

View File

@@ -0,0 +1,16 @@
---
# tasks file for ipaclient
- name: Import variables specific to distribution
include_vars: "{{ item }}"
with_first_found:
- vars/{{ ansible_distribution }}.yml
- vars/default.yml
- name: Install IPA client
include: tasks/install.yml
when: state|default('present') == 'present'
- name: Uninstall IPA client
include: tasks/uninstall.yml
when: state|default('present') == 'absent'

View File

@@ -0,0 +1,11 @@
---
# tasks to uninstall IPA client
- name: Uninstall - Uninstall IPA client
ipaclient:
state: absent
#- name: Remove IPA client package
# package:
# name: "{{ ipaclient_package }}"
# state: absent

View File

@@ -0,0 +1,3 @@
# defaults file for ipaclient
# defaults/fedora.yml
ipaclient_package: freeipa-client

View File

@@ -0,0 +1,4 @@
# defaults file for ipaclient
# defaults/rhel.yml
ipaclient_package: ipa-client