2020-12-10 07:33:09 +00:00
|
|
|
---
|
2020-12-10 07:42:05 +00:00
|
|
|
# Creates the first server for an IPA infrastructure
|
2020-12-11 21:00:14 +00:00
|
|
|
# Recommended specs for the IPA systems, that scale based on number of objects:
|
|
|
|
# CPU: 2 cores
|
|
|
|
# Memory: 4GB
|
|
|
|
# Storage: 10G /var/lib/dirsrv
|
|
|
|
# System fully up to date
|
2020-12-10 07:33:09 +00:00
|
|
|
- name: Configure IPA server
|
|
|
|
hosts: ipaserver
|
|
|
|
become: true
|
|
|
|
vars_files:
|
|
|
|
- vars/encpass.yml
|
|
|
|
|
2020-12-10 23:11:41 +00:00
|
|
|
# This is to try to avoid the handler issue in pre/post tasks
|
|
|
|
handlers:
|
2020-12-13 11:54:31 +00:00
|
|
|
- import_tasks: handlers/main.yml
|
2020-12-10 23:11:41 +00:00
|
|
|
|
2020-12-10 18:07:43 +00:00
|
|
|
pre_tasks:
|
|
|
|
- name: Check if ansible cannot be run here
|
|
|
|
stat:
|
|
|
|
path: /etc/no-ansible
|
|
|
|
register: no_ansible
|
|
|
|
|
|
|
|
- name: Verify if we can run ansible
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "not no_ansible.stat.exists"
|
|
|
|
msg: "/etc/no-ansible exists - skipping run on this node"
|
|
|
|
|
2020-12-11 07:39:15 +00:00
|
|
|
- name: Ensure 'dns=none' is set for Network Manager to avoid change
|
2020-12-10 18:07:43 +00:00
|
|
|
ini_file:
|
|
|
|
path: /etc/NetworkManager/NetworkManager.conf
|
|
|
|
state: present
|
2020-12-11 07:39:15 +00:00
|
|
|
no_extra_spaces: true
|
2020-12-10 18:07:43 +00:00
|
|
|
section: main
|
|
|
|
option: dns
|
|
|
|
value: none
|
|
|
|
owner: root
|
|
|
|
group: root
|
2020-12-11 23:07:58 +00:00
|
|
|
mode: '0644'
|
2020-12-11 07:39:15 +00:00
|
|
|
backup: true
|
2020-12-10 18:07:43 +00:00
|
|
|
notify:
|
|
|
|
- reload_networkmanager
|
|
|
|
|
2020-12-10 07:33:09 +00:00
|
|
|
roles:
|
2020-12-12 18:16:37 +00:00
|
|
|
- role: freeipa.ansible_freeipa.ipaserver
|
|
|
|
state: present
|
2020-12-10 07:33:09 +00:00
|
|
|
|
2020-12-10 18:07:43 +00:00
|
|
|
post_tasks:
|
|
|
|
- name: Touching run file that ansible has ran here
|
|
|
|
file:
|
|
|
|
path: /var/log/ansible.run
|
|
|
|
state: touch
|
2020-12-11 07:39:15 +00:00
|
|
|
mode: '0644'
|
2020-12-11 21:00:14 +00:00
|
|
|
owner: root
|
2020-12-11 07:39:15 +00:00
|
|
|
group: root
|
2020-12-11 22:20:26 +00:00
|
|
|
|
2020-12-16 01:26:57 +00:00
|
|
|
- name: Turn on reverse zone syncing
|
2020-12-12 08:16:44 +00:00
|
|
|
freeipa.ansible_freeipa.ipadnsconfig:
|
2020-12-11 22:20:26 +00:00
|
|
|
ipaadmin_password: '{{ ipaadmin_password }}'
|
|
|
|
allow_sync_ptr: true
|