Merge pull request #1007 from t-woerner/FQCN_ansible_builtin

Use FQCN for ansible.builtin
This commit is contained in:
Rafael Guterres Jeffman
2023-01-03 16:24:19 -03:00
committed by GitHub
155 changed files with 502 additions and 502 deletions

View File

@@ -11,5 +11,5 @@
register: serverconfig register: serverconfig
- name: Display current configuration. - name: Display current configuration.
debug: ansible.builtin.debug:
msg: "{{ serverconfig }}" msg: "{{ serverconfig }}"

View File

@@ -11,5 +11,5 @@
register: result register: result
- name: Zone name inferred from `name_from_ip` - name: Zone name inferred from `name_from_ip`
debug: ansible.builtin.debug:
msg: "Zone created: {{ result.dnszone.name }}" msg: "Zone created: {{ result.dnszone.name }}"

View File

@@ -14,5 +14,5 @@
register: ipahost register: ipahost
- name: Print generated random password - name: Print generated random password
debug: ansible.builtin.debug:
var: ipahost.host.randompassword var: ipahost.host.randompassword

View File

@@ -13,5 +13,5 @@
register: ipahost register: ipahost
- name: Print generated random password - name: Print generated random password
debug: ansible.builtin.debug:
var: ipahost.host.randompassword var: ipahost.host.randompassword

View File

@@ -17,9 +17,9 @@
register: ipahost register: ipahost
- name: Print generated random password for host01.example.com - name: Print generated random password for host01.example.com
debug: ansible.builtin.debug:
var: ipahost.host["host01.example.com"].randompassword var: ipahost.host["host01.example.com"].randompassword
- name: Print generated random password for host02.example.com - name: Print generated random password for host02.example.com
debug: ansible.builtin.debug:
var: ipahost.host["host02.example.com"].randompassword var: ipahost.host["host02.example.com"].randompassword

View File

@@ -15,5 +15,5 @@
register: ipauser register: ipauser
- name: Print generated random password - name: Print generated random password
debug: ansible.builtin.debug:
var: ipauser.user.randompassword var: ipauser.user.randompassword

View File

@@ -20,9 +20,9 @@
register: ipauser register: ipauser
- name: Print generated random password for user1 - name: Print generated random password for user1
debug: ansible.builtin.debug:
var: ipauser.user.user1.randompassword var: ipauser.user.user1.randompassword
- name: Print generated random password for user2 - name: Print generated random password for user2
debug: ansible.builtin.debug:
var: ipauser.user.user2.randompassword var: ipauser.user.user2.randompassword

View File

@@ -15,5 +15,5 @@
register: result register: result
no_log: true no_log: true
- name: Display retrieved data. - name: Display retrieved data.
debug: ansible.builtin.debug:
msg: "Data: {{ result.vault.data }}" msg: "Data: {{ result.vault.data }}"

View File

@@ -15,5 +15,5 @@
register: result register: result
no_log: true no_log: true
- name: Display retrieved data. - name: Display retrieved data.
debug: ansible.builtin.debug:
msg: "Data: {{ result.vault.data }}" msg: "Data: {{ result.vault.data }}"

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Copy file containing password to server. - name: Copy file containing password to server.
copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/password.txt" src: "{{ playbook_dir }}/password.txt"
dest: "{{ ansible_facts['env'].HOME }}/password.txt" dest: "{{ ansible_facts['env'].HOME }}/password.txt"
owner: "{{ ansible_user }}" owner: "{{ ansible_user }}"
@@ -20,6 +20,6 @@
vault_type: symmetric vault_type: symmetric
vault_password_file: "{{ ansible_facts['env'].HOME }}/password.txt" vault_password_file: "{{ ansible_facts['env'].HOME }}/password.txt"
- name: Remove file containing password from server. - name: Remove file containing password from server.
file: ansible.builtin.file:
path: "{{ ansible_facts['env'].HOME }}/password.txt" path: "{{ ansible_facts['env'].HOME }}/password.txt"
state: absent state: absent

View File

@@ -11,7 +11,7 @@
tasks: tasks:
- name: Copy public key file to server. - name: Copy public key file to server.
copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/public.pem" src: "{{ playbook_dir }}/public.pem"
dest: "{{ ansible_facts['env'].HOME }}/public.pem" dest: "{{ ansible_facts['env'].HOME }}/public.pem"
owner: "{{ ansible_user }}" owner: "{{ ansible_user }}"
@@ -25,6 +25,6 @@
vault_type: asymmetric vault_type: asymmetric
vault_public_key_file: "{{ ansible_facts['env'].HOME }}/public.pem" vault_public_key_file: "{{ ansible_facts['env'].HOME }}/public.pem"
- name: Remove public key file from server. - name: Remove public key file from server.
file: ansible.builtin.file:
path: "{{ ansible_facts['env'].HOME }}/public.pem" path: "{{ ansible_facts['env'].HOME }}/public.pem"
state: absent state: absent

View File

@@ -2,7 +2,7 @@
# tasks file for ipabackup # tasks file for ipabackup
- name: Create backup - name: Create backup
shell: > ansible.builtin.shell: >
ipa-backup ipa-backup
{{ "--gpg" if ipabackup_gpg | bool else "" }} {{ "--gpg" if ipabackup_gpg | bool else "" }}
{{ "--gpg-keyring="+ipabackup_gpg_keyring if ipabackup_gpg_keyring is defined else "" }} {{ "--gpg-keyring="+ipabackup_gpg_keyring if ipabackup_gpg_keyring is defined else "" }}
@@ -15,7 +15,7 @@
- block: - block:
- name: Get ipabackup_item from stderr or stdout output - name: Get ipabackup_item from stderr or stdout output
set_fact: ansible.builtin.set_fact:
ipabackup_item: "{{ item | regex_search('\n.*/([^\n]+)','\\1') | first }}" ipabackup_item: "{{ item | regex_search('\n.*/([^\n]+)','\\1') | first }}"
when: item.find("Backed up to "+ipabackup_dir+"/") > 0 when: item.find("Backed up to "+ipabackup_dir+"/") > 0
with_items: with_items:
@@ -25,15 +25,15 @@
label: "" label: ""
- name: Fail on missing ipabackup_item - name: Fail on missing ipabackup_item
fail: msg="Failed to get ipabackup_item" ansible.builtin.fail: msg="Failed to get ipabackup_item"
when: ipabackup_item is not defined when: ipabackup_item is not defined
- name: Copy backup to controller - name: Copy backup to controller
include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml"
when: state|default("present") == "present" when: state|default("present") == "present"
- name: Remove backup on server - name: Remove backup on server
include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml"
when: not ipabackup_keep_on_server when: not ipabackup_keep_on_server
when: ipabackup_to_controller when: ipabackup_to_controller

View File

@@ -1,36 +1,36 @@
--- ---
- name: Fail on invalid ipabackup_item - name: Fail on invalid ipabackup_item
fail: msg="ipabackup_item {{ ipabackup_item }} is not valid" ansible.builtin.fail: msg="ipabackup_item {{ ipabackup_item }} is not valid"
when: ipabackup_item is not defined or when: ipabackup_item is not defined or
ipabackup_item | length < 1 or ipabackup_item | length < 1 or
(ipabackup_item.find("ipa-full-") == -1 and (ipabackup_item.find("ipa-full-") == -1 and
ipabackup_item.find("ipa-data-") == -1) ipabackup_item.find("ipa-data-") == -1)
- name: Set controller destination directory - name: Set controller destination directory
set_fact: ansible.builtin.set_fact:
ipabackup_controller_dir: ipabackup_controller_dir:
"{{ ipabackup_controller_path | default(lookup('env','PWD')) }}/{{ "{{ ipabackup_controller_path | default(lookup('env','PWD')) }}/{{
ipabackup_name_prefix | default(ansible_facts['fqdn']) }}_{{ ipabackup_name_prefix | default(ansible_facts['fqdn']) }}_{{
ipabackup_item }}/" ipabackup_item }}/"
- name: Stat backup on server - name: Stat backup on server
stat: ansible.builtin.stat:
path: "{{ ipabackup_dir }}/{{ ipabackup_item }}" path: "{{ ipabackup_dir }}/{{ ipabackup_item }}"
register: result_backup_stat register: result_backup_stat
- name: Fail on missing backup directory - name: Fail on missing backup directory
fail: msg="Unable to find backup {{ ipabackup_item }}" ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_item }}"
when: result_backup_stat.stat.isdir is not defined when: result_backup_stat.stat.isdir is not defined
- name: Get backup files to copy for "{{ ipabackup_item }}" - name: Get backup files to copy for "{{ ipabackup_item }}"
shell: ansible.builtin.shell:
find . -type f | cut -d"/" -f 2 find . -type f | cut -d"/" -f 2
args: args:
chdir: "{{ ipabackup_dir }}/{{ ipabackup_item }}" chdir: "{{ ipabackup_dir }}/{{ ipabackup_item }}"
register: result_find_backup_files register: result_find_backup_files
- name: Copy server backup files to controller - name: Copy server backup files to controller
fetch: ansible.builtin.fetch:
flat: yes flat: yes
src: "{{ ipabackup_dir }}/{{ ipabackup_item }}/{{ item }}" src: "{{ ipabackup_dir }}/{{ ipabackup_item }}/{{ item }}"
dest: "{{ ipabackup_controller_dir }}" dest: "{{ ipabackup_controller_dir }}"
@@ -38,7 +38,7 @@
- "{{ result_find_backup_files.stdout_lines }}" - "{{ result_find_backup_files.stdout_lines }}"
- name: Fix file modes for backup on controller - name: Fix file modes for backup on controller
file: ansible.builtin.file:
dest: "{{ ipabackup_controller_dir }}" dest: "{{ ipabackup_controller_dir }}"
mode: u=rwX,go= mode: u=rwX,go=
recurse: yes recurse: yes

View File

@@ -1,40 +1,40 @@
--- ---
- name: Fail on invalid ipabackup_name - name: Fail on invalid ipabackup_name
fail: msg="ipabackup_name {{ ipabackup_name }} is not valid" ansible.builtin.fail: msg="ipabackup_name {{ ipabackup_name }} is not valid"
when: ipabackup_name is not defined or when: ipabackup_name is not defined or
ipabackup_name | length < 1 or ipabackup_name | length < 1 or
(ipabackup_name.find("ipa-full-") == -1 and (ipabackup_name.find("ipa-full-") == -1 and
ipabackup_name.find("ipa-data-") == -1) ipabackup_name.find("ipa-data-") == -1)
- name: Set controller source directory - name: Set controller source directory
set_fact: ansible.builtin.set_fact:
ipabackup_controller_dir: ipabackup_controller_dir:
"{{ ipabackup_controller_path | default(lookup('env','PWD')) }}" "{{ ipabackup_controller_path | default(lookup('env','PWD')) }}"
- name: Set ipabackup_item - name: Set ipabackup_item
set_fact: ansible.builtin.set_fact:
ipabackup_item: ipabackup_item:
"{{ ipabackup_name | regex_search('.*_(ipa-.+)','\\1') | first }}" "{{ ipabackup_name | regex_search('.*_(ipa-.+)','\\1') | first }}"
when: "'_ipa-' in ipabackup_name" when: "'_ipa-' in ipabackup_name"
- name: Set ipabackup_item - name: Set ipabackup_item
set_fact: ansible.builtin.set_fact:
ipabackup_item: "{{ ipabackup_name }}" ipabackup_item: "{{ ipabackup_name }}"
when: "'_ipa-' not in ipabackup_name" when: "'_ipa-' not in ipabackup_name"
- name: Stat backup to copy - name: Stat backup to copy
stat: ansible.builtin.stat:
path: "{{ ipabackup_controller_dir }}/{{ ipabackup_name }}" path: "{{ ipabackup_controller_dir }}/{{ ipabackup_name }}"
register: result_backup_stat register: result_backup_stat
delegate_to: localhost delegate_to: localhost
become: no become: no
- name: Fail on missing backup to copy - name: Fail on missing backup to copy
fail: msg="Unable to find backup {{ ipabackup_name }}" ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_name }}"
when: result_backup_stat.stat.isdir is not defined when: result_backup_stat.stat.isdir is not defined
- name: Copy backup files to server for "{{ ipabackup_item }}" - name: Copy backup files to server for "{{ ipabackup_item }}"
copy: ansible.builtin.copy:
src: "{{ ipabackup_controller_dir }}/{{ ipabackup_name }}/" src: "{{ ipabackup_controller_dir }}/{{ ipabackup_name }}/"
dest: "{{ ipabackup_dir }}/{{ ipabackup_item }}" dest: "{{ ipabackup_dir }}/{{ ipabackup_item }}"
owner: root owner: root

View File

@@ -4,5 +4,5 @@
register: result_ipabackup_get_backup_dir register: result_ipabackup_get_backup_dir
- name: Set IPA backup dir - name: Set IPA backup dir
set_fact: ansible.builtin.set_fact:
ipabackup_dir: "{{ result_ipabackup_get_backup_dir.backup_dir }}" ipabackup_dir: "{{ result_ipabackup_get_backup_dir.backup_dir }}"

View File

@@ -2,7 +2,7 @@
# tasks file for ipabackup # tasks file for ipabackup
- name: Check for empty vars - name: Check for empty vars
fail: msg="Variable {{ item }} is empty" ansible.builtin.fail: msg="Variable {{ item }} is empty"
when: "item in vars and not vars[item]" when: "item in vars and not vars[item]"
with_items: "{{ ipabackup_empty_var_checks }}" with_items: "{{ ipabackup_empty_var_checks }}"
vars: vars:
@@ -18,43 +18,43 @@
- ipabackup_firewalld_zone - ipabackup_firewalld_zone
- name: Set ipabackup_data if ipabackup_data is not set but ipabackup_online is - name: Set ipabackup_data if ipabackup_data is not set but ipabackup_online is
set_fact: ansible.builtin.set_fact:
ipabackup_data: yes ipabackup_data: yes
when: ipabackup_online | bool and not ipabackup_data | bool when: ipabackup_online | bool and not ipabackup_data | bool
- name: Fail if ipabackup_from_controller and ipabackup_to_controller are set - name: Fail if ipabackup_from_controller and ipabackup_to_controller are set
fail: msg="ipabackup_from_controller and ipabackup_to_controller are set" ansible.builtin.fail: msg="ipabackup_from_controller and ipabackup_to_controller are set"
when: ipabackup_from_controller | bool and ipabackup_to_controller | bool when: ipabackup_from_controller | bool and ipabackup_to_controller | bool
- name: Fail for given ipabackup_name if state is not copied, restored or absent - name: Fail for given ipabackup_name if state is not copied, restored or absent
fail: msg="ipabackup_name is given and state is not copied, restored or absent" ansible.builtin.fail: msg="ipabackup_name is given and state is not copied, restored or absent"
when: state is not defined or when: state is not defined or
(state != "copied" and state != "restored" and state != "absent") and (state != "copied" and state != "restored" and state != "absent") and
ipabackup_name is defined ipabackup_name is defined
- name: Get ipabackup_dir from IPA installation - name: Get ipabackup_dir from IPA installation
include_tasks: "{{ role_path }}/tasks/get_ipabackup_dir.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/get_ipabackup_dir.yml"
- name: Backup IPA server - name: Backup IPA server
include_tasks: "{{ role_path }}/tasks/backup.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/backup.yml"
when: state|default("present") == "present" when: state|default("present") == "present"
- name: Fail on missing ipabackup_name - name: Fail on missing ipabackup_name
fail: msg="ipabackup_name is not set" ansible.builtin.fail: msg="ipabackup_name is not set"
when: (ipabackup_name is not defined or not ipabackup_name) and when: (ipabackup_name is not defined or not ipabackup_name) and
state is defined and state is defined and
(state == "copied" or state == "restored" or state == "absent") (state == "copied" or state == "restored" or state == "absent")
- block: - block:
- name: Get list of all backups on IPA server - name: Get list of all backups on IPA server
shell: ansible.builtin.shell:
find . -name "ipa-full-*" -o -name "ipa-data-*" | cut -d"/" -f 2 find . -name "ipa-full-*" -o -name "ipa-data-*" | cut -d"/" -f 2
args: args:
chdir: "{{ ipabackup_dir }}/" chdir: "{{ ipabackup_dir }}/"
register: result_backup_find_backup_files register: result_backup_find_backup_files
- name: Set ipabackup_names using backup list - name: Set ipabackup_names using backup list
set_fact: ansible.builtin.set_fact:
ipabackup_names: "{{ result_backup_find_backup_files.stdout_lines }}" ipabackup_names: "{{ result_backup_find_backup_files.stdout_lines }}"
when: state is defined and when: state is defined and
@@ -64,28 +64,28 @@
- block: - block:
- name: Fail on ipabackup_name all - name: Fail on ipabackup_name all
fail: msg="ipabackup_name can not be all in this case" ansible.builtin.fail: msg="ipabackup_name can not be all in this case"
when: ipabackup_name is defined and ipabackup_name == "all" when: ipabackup_name is defined and ipabackup_name == "all"
- name: Set ipabackup_names from ipabackup_name string - name: Set ipabackup_names from ipabackup_name string
set_fact: ansible.builtin.set_fact:
ipabackup_names: ["{{ ipabackup_name }}"] ipabackup_names: ["{{ ipabackup_name }}"]
when: ipabackup_name | type_debug != "list" when: ipabackup_name | type_debug != "list"
- name: Set ipabackup_names from ipabackup_name list - name: Set ipabackup_names from ipabackup_name list
set_fact: ansible.builtin.set_fact:
ipabackup_names: "{{ ipabackup_name }}" ipabackup_names: "{{ ipabackup_name }}"
when: ipabackup_name | type_debug == "list" when: ipabackup_name | type_debug == "list"
when: ipabackup_names is not defined and ipabackup_name is defined when: ipabackup_names is not defined and ipabackup_name is defined
- name: Set empty ipabackup_names if ipabackup_name is not defined - name: Set empty ipabackup_names if ipabackup_name is not defined
set_fact: ansible.builtin.set_fact:
ipabackup_names: [] ipabackup_names: []
when: ipabackup_names is not defined and ipabackup_name is not defined when: ipabackup_names is not defined and ipabackup_name is not defined
- block: - block:
- name: Copy backup from IPA server - name: Copy backup from IPA server
include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml"
vars: vars:
ipabackup_item: "{{ main_item | basename }}" ipabackup_item: "{{ main_item | basename }}"
with_items: with_items:
@@ -95,7 +95,7 @@
when: state is defined and state == "copied" when: state is defined and state == "copied"
- name: Remove backup from IPA server - name: Remove backup from IPA server
include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml"
vars: vars:
ipabackup_item: "{{ main_item | basename }}" ipabackup_item: "{{ main_item | basename }}"
with_items: with_items:
@@ -111,7 +111,7 @@
# restore. # restore.
- name: Fail to copy or restore more than one backup on the server - name: Fail to copy or restore more than one backup on the server
fail: msg="Only one backup can be copied to the server or restored" ansible.builtin.fail: msg="Only one backup can be copied to the server or restored"
when: state is defined and (state == "copied" or state == "restored") and when: state is defined and (state == "copied" or state == "restored") and
ipabackup_from_controller | bool and ipabackup_names | length != 1 ipabackup_from_controller | bool and ipabackup_names | length != 1
@@ -119,10 +119,10 @@
- block: - block:
- name: Copy backup to server - name: Copy backup to server
include_tasks: "{{ role_path }}/tasks/copy_backup_to_server.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_to_server.yml"
- name: Restore IPA server after copy - name: Restore IPA server after copy
include_tasks: "{{ role_path }}/tasks/restore.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml"
when: state|default("present") == "restored" when: state|default("present") == "restored"
vars: vars:
@@ -131,7 +131,7 @@
(state|default("present") == "copied" and not ipabackup_to_controller) (state|default("present") == "copied" and not ipabackup_to_controller)
- name: Restore IPA server - name: Restore IPA server
include_tasks: "{{ role_path }}/tasks/restore.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml"
vars: vars:
ipabackup_item: "{{ ipabackup_names[0] | basename }}" ipabackup_item: "{{ ipabackup_names[0] | basename }}"
when: not ipabackup_from_controller and when: not ipabackup_from_controller and

View File

@@ -1,5 +1,5 @@
--- ---
- name: Remove backup "{{ ipabackup_item }}" - name: Remove backup "{{ ipabackup_item }}"
file: ansible.builtin.file:
path: "{{ ipabackup_dir }}/{{ ipabackup_item }}" path: "{{ ipabackup_dir }}/{{ ipabackup_item }}"
state: absent state: absent

View File

@@ -4,7 +4,7 @@
### VARIABLES ### VARIABLES
- name: Import variables specific to distribution - name: Import variables specific to distribution
include_vars: "{{ item }}" ansible.builtin.include_vars: "{{ item }}"
with_first_found: with_first_found:
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
@@ -21,30 +21,30 @@
### GET SERVICES FROM BACKUP ### GET SERVICES FROM BACKUP
- name: Stat backup on server - name: Stat backup on server
stat: ansible.builtin.stat:
path: "{{ ipabackup_dir }}/{{ ipabackup_item }}" path: "{{ ipabackup_dir }}/{{ ipabackup_item }}"
register: result_backup_stat register: result_backup_stat
- name: Fail on missing backup directory - name: Fail on missing backup directory
fail: msg="Unable to find backup {{ ipabackup_item }}" ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_item }}"
when: result_backup_stat.stat.isdir is not defined when: result_backup_stat.stat.isdir is not defined
- name: Stat header file in backup "{{ ipabackup_item }}" - name: Stat header file in backup "{{ ipabackup_item }}"
stat: ansible.builtin.stat:
path: "{{ ipabackup_dir }}/{{ ipabackup_item }}/header" path: "{{ ipabackup_dir }}/{{ ipabackup_item }}/header"
register: result_backup_header_stat register: result_backup_header_stat
- name: Fail on missing header file in backup - name: Fail on missing header file in backup
fail: msg="Unable to find backup {{ ipabackup_item }} header file" ansible.builtin.fail: msg="Unable to find backup {{ ipabackup_item }} header file"
when: result_backup_header_stat.stat.isreg is not defined when: result_backup_header_stat.stat.isreg is not defined
- name: Get services from backup - name: Get services from backup
shell: > ansible.builtin.shell: >
grep "^services = " "{{ ipabackup_dir }}/{{ ipabackup_item }}/header" | cut -d"=" -f2 | tr -d '[:space:]' grep "^services = " "{{ ipabackup_dir }}/{{ ipabackup_item }}/header" | cut -d"=" -f2 | tr -d '[:space:]'
register: result_services_grep register: result_services_grep
- name: Set ipabackup_services - name: Set ipabackup_services
set_fact: ansible.builtin.set_fact:
ipabackup_services: "{{ result_services_grep.stdout.split(',') }}" ipabackup_services: "{{ result_services_grep.stdout.split(',') }}"
ipabackup_service_dns: DNS ipabackup_service_dns: DNS
ipabackup_service_adtrust: ADTRUST ipabackup_service_adtrust: ADTRUST
@@ -54,24 +54,24 @@
- block: - block:
- name: Ensure that IPA server packages are installed - name: Ensure that IPA server packages are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages }}" name: "{{ ipaserver_packages }}"
state: present state: present
- name: Ensure that IPA server packages for dns are installed - name: Ensure that IPA server packages for dns are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages_dns }}" name: "{{ ipaserver_packages_dns }}"
state: present state: present
when: ipabackup_service_dns in ipabackup_services when: ipabackup_service_dns in ipabackup_services
- name: Ensure that IPA server packages for adtrust are installed - name: Ensure that IPA server packages for adtrust are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages_adtrust }}" name: "{{ ipaserver_packages_adtrust }}"
state: present state: present
when: ipabackup_service_adtrust in ipabackup_services when: ipabackup_service_adtrust in ipabackup_services
- name: Ensure that firewalld packages are installed - name: Ensure that firewalld packages are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages_firewalld }}" name: "{{ ipaserver_packages_firewalld }}"
state: present state: present
when: ipabackup_setup_firewalld | bool when: ipabackup_setup_firewalld | bool
@@ -82,20 +82,20 @@
- block: - block:
- name: Ensure that firewalld is running - name: Ensure that firewalld is running
systemd: ansible.builtin.systemd:
name: firewalld name: firewalld
enabled: yes enabled: yes
state: started state: started
- name: Firewalld - Verify runtime zone "{{ ipabackup_firewalld_zone }}" - name: Firewalld - Verify runtime zone "{{ ipabackup_firewalld_zone }}"
shell: > ansible.builtin.shell: >
firewall-cmd firewall-cmd
--info-zone="{{ ipabackup_firewalld_zone }}" --info-zone="{{ ipabackup_firewalld_zone }}"
>/dev/null >/dev/null
when: ipabackup_firewalld_zone is defined when: ipabackup_firewalld_zone is defined
- name: Firewalld - Verify permanent zone "{{ ipabackup_firewalld_zone }}" - name: Firewalld - Verify permanent zone "{{ ipabackup_firewalld_zone }}"
shell: > ansible.builtin.shell: >
firewall-cmd firewall-cmd
--permanent --permanent
--info-zone="{{ ipabackup_firewalld_zone }}" --info-zone="{{ ipabackup_firewalld_zone }}"
@@ -108,7 +108,7 @@
- name: Restore backup - name: Restore backup
no_log: True no_log: True
shell: > ansible.builtin.shell: >
ipa-restore ipa-restore
{{ ipabackup_item }} {{ ipabackup_item }}
--unattended --unattended
@@ -123,7 +123,7 @@
ignore_errors: yes ignore_errors: yes
- name: Report error for restore operation - name: Report error for restore operation
debug: ansible.builtin.debug:
msg: "{{ result_iparestore.stderr }}" msg: "{{ result_iparestore.stderr }}"
when: result_iparestore is failed when: result_iparestore is failed
failed_when: yes failed_when: yes
@@ -131,7 +131,7 @@
### CONFIGURE FIREWALLD ### CONFIGURE FIREWALLD
- name: Configure firewalld - name: Configure firewalld
command: > ansible.builtin.command: >
firewall-cmd firewall-cmd
--permanent --permanent
{{ "--zone="+ipabackup_firewalld_zone if ipabackup_firewalld_zone is defined else "" }} {{ "--zone="+ipabackup_firewalld_zone if ipabackup_firewalld_zone is defined else "" }}
@@ -143,7 +143,7 @@
when: ipabackup_setup_firewalld | bool when: ipabackup_setup_firewalld | bool
- name: Configure firewalld runtime - name: Configure firewalld runtime
command: > ansible.builtin.command: >
firewall-cmd firewall-cmd
{{ "--zone="+ipabackup_firewalld_zone if ipabackup_firewalld_zone is defined else "" }} {{ "--zone="+ipabackup_firewalld_zone if ipabackup_firewalld_zone is defined else "" }}
--add-service=freeipa-ldap --add-service=freeipa-ldap

View File

@@ -2,28 +2,28 @@
# tasks file for ipaclient # tasks file for ipaclient
- name: Install - Ensure that IPA client packages are installed - name: Install - Ensure that IPA client packages are installed
package: ansible.builtin.package:
name: "{{ ipaclient_packages }}" name: "{{ ipaclient_packages }}"
state: present state: present
when: ipaclient_install_packages | bool when: ipaclient_install_packages | bool
- name: Install - Set ipaclient_servers - name: Install - Set ipaclient_servers
set_fact: ansible.builtin.set_fact:
ipaclient_servers: "{{ groups['ipaservers'] | list }}" ipaclient_servers: "{{ groups['ipaservers'] | list }}"
when: groups.ipaservers is defined and ipaclient_servers is not defined when: groups.ipaservers is defined and ipaclient_servers is not defined
- name: Install - Set ipaclient_servers from cluster inventory - name: Install - Set ipaclient_servers from cluster inventory
set_fact: ansible.builtin.set_fact:
ipaclient_servers: "{{ groups['ipaserver'] | list }}" ipaclient_servers: "{{ groups['ipaserver'] | list }}"
when: ipaclient_no_dns_lookup | bool and groups.ipaserver is defined and when: ipaclient_no_dns_lookup | bool and groups.ipaserver is defined and
ipaclient_servers is not defined ipaclient_servers is not defined
- name: Install - Check that either password or keytab is set - name: Install - Check that either password or keytab is set
fail: msg="ipaadmin_password and ipaadmin_keytab cannot be used together" ansible.builtin.fail: msg="ipaadmin_password and ipaadmin_keytab cannot be used together"
when: ipaadmin_keytab is defined and ipaadmin_password is defined when: ipaadmin_keytab is defined and ipaadmin_password is defined
- name: Install - Set default principal if no keytab is given - name: Install - Set default principal if no keytab is given
set_fact: ansible.builtin.set_fact:
ipaadmin_principal: admin ipaadmin_principal: admin
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
@@ -31,11 +31,11 @@
block: block:
- name: Install - Fail on missing ipaclient_domain and ipaserver_domain - name: Install - Fail on missing ipaclient_domain and ipaserver_domain
fail: msg="ipaclient_domain or ipaserver_domain is required for ipaclient_configure_dns_resolver" ansible.builtin.fail: msg="ipaclient_domain or ipaserver_domain is required for ipaclient_configure_dns_resolver"
when: ipaserver_domain is not defined and ipaclient_domain is not defined when: ipaserver_domain is not defined and ipaclient_domain is not defined
- name: Install - Fail on missing ipaclient_servers - name: Install - Fail on missing ipaclient_servers
fail: msg="ipaclient_dns_servers is required for ipaclient_configure_dns_resolver" ansible.builtin.fail: msg="ipaclient_dns_servers is required for ipaclient_configure_dns_resolver"
when: ipaclient_dns_servers is not defined when: ipaclient_dns_servers is not defined
- name: Install - Configure DNS resolver - name: Install - Configure DNS resolver
@@ -74,7 +74,7 @@
- block: - block:
- name: Install - Cleanup leftover ccache - name: Install - Cleanup leftover ccache
file: ansible.builtin.file:
path: "/etc/ipa/.dns_ccache" path: "/etc/ipa/.dns_ccache"
state: absent state: absent
@@ -91,12 +91,12 @@
domain: "{{ result_ipaclient_test.domain }}" domain: "{{ result_ipaclient_test.domain }}"
- name: Install - Make sure One-Time Password is enabled if it's already defined - name: Install - Make sure One-Time Password is enabled if it's already defined
set_fact: ansible.builtin.set_fact:
ipaclient_use_otp: "yes" ipaclient_use_otp: "yes"
when: ipaclient_otp is defined when: ipaclient_otp is defined
- name: Install - Disable One-Time Password for on_master - name: Install - Disable One-Time Password for on_master
set_fact: ansible.builtin.set_fact:
ipaclient_use_otp: "no" ipaclient_use_otp: "no"
when: ipaclient_use_otp | bool and ipaclient_on_master | bool when: ipaclient_use_otp | bool and ipaclient_on_master | bool
@@ -112,7 +112,7 @@
- name: Install - Disable One-Time Password for client with working - name: Install - Disable One-Time Password for client with working
krb5.keytab krb5.keytab
set_fact: ansible.builtin.set_fact:
ipaclient_use_otp: "no" ipaclient_use_otp: "no"
when: ipaclient_use_otp | bool and when: ipaclient_use_otp | bool and
result_ipaclient_test_keytab.krb5_keytab_ok and result_ipaclient_test_keytab.krb5_keytab_ok and
@@ -159,14 +159,14 @@
delegate_to: "{{ result_ipaclient_test.servers[0] }}" delegate_to: "{{ result_ipaclient_test.servers[0] }}"
- name: Install - Report error for OTP generation - name: Install - Report error for OTP generation
debug: ansible.builtin.debug:
msg: "{{ result_ipaclient_get_otp.msg }}" msg: "{{ result_ipaclient_get_otp.msg }}"
when: result_ipaclient_get_otp is failed when: result_ipaclient_get_otp is failed
failed_when: yes failed_when: yes
- name: Install - Store the previously obtained OTP - name: Install - Store the previously obtained OTP
no_log: yes no_log: yes
set_fact: ansible.builtin.set_fact:
ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}" ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}"
ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword
if result_ipaclient_get_otp.host is defined }}" if result_ipaclient_get_otp.host is defined }}"
@@ -183,7 +183,7 @@
- name: Store predefined OTP in admin_password - name: Store predefined OTP in admin_password
no_log: yes no_log: yes
set_fact: ansible.builtin.set_fact:
ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}" ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}"
ipaadmin_password: "{{ ipaclient_otp }}" ipaadmin_password: "{{ ipaclient_otp }}"
when: ipaclient_otp is defined when: ipaclient_otp is defined
@@ -198,11 +198,11 @@
# result_ipaclient_join.already_joined))) # result_ipaclient_join.already_joined)))
- name: Install - Check if principal and keytab are set - name: Install - Check if principal and keytab are set
fail: msg="Admin principal and client keytab cannot be used together" ansible.builtin.fail: msg="Admin principal and client keytab cannot be used together"
when: ipaadmin_principal is defined and ipaclient_keytab is defined when: ipaadmin_principal is defined and ipaclient_keytab is defined
- name: Install - Check if one of password or keytabs are set - name: Install - Check if one of password or keytabs are set
fail: msg="At least one of password or keytabs must be specified" ansible.builtin.fail: msg="At least one of password or keytabs must be specified"
when: not result_ipaclient_test_keytab.krb5_keytab_ok when: not result_ipaclient_test_keytab.krb5_keytab_ok
and ipaadmin_password is undefined and ipaadmin_password is undefined
and ipaadmin_keytab is undefined and ipaadmin_keytab is undefined
@@ -210,7 +210,7 @@
when: not ipaclient_on_master | bool when: not ipaclient_on_master | bool
- name: Install - Purge {{ result_ipaclient_test.realm }} from host keytab - name: Install - Purge {{ result_ipaclient_test.realm }} from host keytab
command: > ansible.builtin.command: >
/usr/sbin/ipa-rmkeytab /usr/sbin/ipa-rmkeytab
-k /etc/krb5.keytab -k /etc/krb5.keytab
-r "{{ result_ipaclient_test.realm }}" -r "{{ result_ipaclient_test.realm }}"
@@ -254,17 +254,17 @@
- block: - block:
- name: krb5 configuration not correct - name: krb5 configuration not correct
fail: ansible.builtin.fail:
msg: > msg: >
The krb5 configuration is not correct, please enable allow_repair The krb5 configuration is not correct, please enable allow_repair
to fix this. to fix this.
when: not result_ipaclient_test_keytab.krb5_conf_ok when: not result_ipaclient_test_keytab.krb5_conf_ok
- name: IPA test failed - name: IPA test failed
fail: ansible.builtin.fail:
msg: "The IPA test failed, please enable allow_repair to fix this." msg: "The IPA test failed, please enable allow_repair to fix this."
when: not result_ipaclient_test_keytab.ping_test_ok when: not result_ipaclient_test_keytab.ping_test_ok
- name: ca.crt file is missing - name: ca.crt file is missing
fail: ansible.builtin.fail:
msg: > msg: >
The ca.crt file is missing, please enable allow_repair to fix this. The ca.crt file is missing, please enable allow_repair to fix this.
when: not result_ipaclient_test_keytab.ca_crt_exists when: not result_ipaclient_test_keytab.ca_crt_exists
@@ -411,11 +411,11 @@
always: always:
- name: Install - Restore original admin password if overwritten by OTP - name: Install - Restore original admin password if overwritten by OTP
no_log: yes no_log: yes
set_fact: ansible.builtin.set_fact:
ipaadmin_password: "{{ ipaadmin_orig_password }}" ipaadmin_password: "{{ ipaadmin_orig_password }}"
when: ipaclient_use_otp | bool and ipaadmin_orig_password is defined when: ipaclient_use_otp | bool and ipaadmin_orig_password is defined
- name: Cleanup leftover ccache - name: Cleanup leftover ccache
file: ansible.builtin.file:
path: "/etc/ipa/.dns_ccache" path: "/etc/ipa/.dns_ccache"
state: absent state: absent

View File

@@ -2,7 +2,7 @@
# tasks file for ipaclient # tasks file for ipaclient
- name: Import variables specific to distribution - name: Import variables specific to distribution
include_vars: "{{ item }}" ansible.builtin.include_vars: "{{ item }}"
with_first_found: with_first_found:
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" - "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
@@ -17,9 +17,9 @@
- "{{ role_path }}/vars/default.yml" - "{{ role_path }}/vars/default.yml"
- name: Install IPA client - name: Install IPA client
include_tasks: install.yml ansible.builtin.include_tasks: install.yml
when: state|default('present') == 'present' when: state|default('present') == 'present'
- name: Uninstall IPA client - name: Uninstall IPA client
include_tasks: uninstall.yml ansible.builtin.include_tasks: uninstall.yml
when: state|default('present') == 'absent' when: state|default('present') == 'absent'

View File

@@ -2,7 +2,7 @@
# tasks to uninstall IPA client # tasks to uninstall IPA client
- name: Uninstall - Uninstall IPA client - name: Uninstall - Uninstall IPA client
command: > ansible.builtin.command: >
/usr/sbin/ipa-client-install /usr/sbin/ipa-client-install
--uninstall --uninstall
-U -U
@@ -17,6 +17,6 @@
when: ipaclient_cleanup_dns_resolver | bool when: ipaclient_cleanup_dns_resolver | bool
#- name: Remove IPA client package #- name: Remove IPA client package
# package: # ansible.builtin.package:
# name: "{{ ipaclient_packages }}" # name: "{{ ipaclient_packages }}"
# state: absent # state: absent

View File

@@ -4,24 +4,24 @@
- block: - block:
- name: Install - Ensure IPA replica packages are installed - name: Install - Ensure IPA replica packages are installed
package: ansible.builtin.package:
name: "{{ ipareplica_packages }}" name: "{{ ipareplica_packages }}"
state: present state: present
- name: Install - Ensure IPA replica packages for dns are installed - name: Install - Ensure IPA replica packages for dns are installed
package: ansible.builtin.package:
name: "{{ ipareplica_packages_dns }}" name: "{{ ipareplica_packages_dns }}"
state: present state: present
when: ipareplica_setup_dns | bool when: ipareplica_setup_dns | bool
- name: Install - Ensure IPA replica packages for adtrust are installed - name: Install - Ensure IPA replica packages for adtrust are installed
package: ansible.builtin.package:
name: "{{ ipareplica_packages_adtrust }}" name: "{{ ipareplica_packages_adtrust }}"
state: present state: present
when: ipareplica_setup_adtrust | bool when: ipareplica_setup_adtrust | bool
- name: Install - Ensure that firewall packages installed - name: Install - Ensure that firewall packages installed
package: ansible.builtin.package:
name: "{{ ipareplica_packages_firewalld }}" name: "{{ ipareplica_packages_firewalld }}"
state: present state: present
when: ipareplica_setup_firewalld | bool when: ipareplica_setup_firewalld | bool
@@ -30,20 +30,20 @@
- block: - block:
- name: Firewalld service - Ensure that firewalld is running - name: Firewalld service - Ensure that firewalld is running
systemd: ansible.builtin.systemd:
name: firewalld name: firewalld
enabled: yes enabled: yes
state: started state: started
- name: Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}" - name: Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}"
shell: > ansible.builtin.shell: >
firewall-cmd firewall-cmd
--info-zone="{{ ipareplica_firewalld_zone }}" --info-zone="{{ ipareplica_firewalld_zone }}"
>/dev/null >/dev/null
when: ipareplica_firewalld_zone is defined when: ipareplica_firewalld_zone is defined
- name: Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}" - name: Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}"
shell: > ansible.builtin.shell: >
firewall-cmd firewall-cmd
--permanent --permanent
--info-zone="{{ ipareplica_firewalld_zone }}" --info-zone="{{ ipareplica_firewalld_zone }}"
@@ -53,12 +53,12 @@
when: ipareplica_setup_firewalld | bool when: ipareplica_setup_firewalld | bool
- name: Install - Set ipareplica_servers - name: Install - Set ipareplica_servers
set_fact: ansible.builtin.set_fact:
ipareplica_servers: "{{ groups['ipaservers'] | list }}" ipareplica_servers: "{{ groups['ipaservers'] | list }}"
when: groups.ipaservers is defined and ipareplica_servers is not defined when: groups.ipaservers is defined and ipareplica_servers is not defined
- name: Install - Set default principal if no keytab is given - name: Install - Set default principal if no keytab is given
set_fact: ansible.builtin.set_fact:
ipaadmin_principal: admin ipaadmin_principal: admin
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
@@ -108,7 +108,7 @@
# result_ipareplica_test.server_already_configured is defined) # result_ipareplica_test.server_already_configured is defined)
- name: Install - Setup client - name: Install - Setup client
include_role: ansible.builtin.include_role:
name: ipaclient name: ipaclient
vars: vars:
state: present state: present
@@ -120,7 +120,7 @@
when: not result_ipareplica_test.client_enrolled when: not result_ipareplica_test.client_enrolled
- name: Install - Configure firewalld - name: Install - Configure firewalld
command: > ansible.builtin.command: >
firewall-cmd firewall-cmd
--permanent --permanent
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is --zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
@@ -134,7 +134,7 @@
when: ipareplica_setup_firewalld | bool when: ipareplica_setup_firewalld | bool
- name: Install - Configure firewalld runtime - name: Install - Configure firewalld runtime
command: > ansible.builtin.command: >
firewall-cmd firewall-cmd
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is --zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
defined else '' }}" defined else '' }}"
@@ -222,7 +222,7 @@
- name: Install - Set dirman password - name: Install - Set dirman password
no_log: yes no_log: yes
set_fact: ansible.builtin.set_fact:
ipareplica_dirman_password: ipareplica_dirman_password:
"{{ result_ipareplica_master_password.password }}" "{{ result_ipareplica_master_password.password }}"
@@ -776,14 +776,14 @@
register: result_ipareplica_enable_ipa register: result_ipareplica_enable_ipa
- name: Install - Cleanup root IPA cache - name: Install - Cleanup root IPA cache
file: ansible.builtin.file:
path: "/root/.ipa_cache" path: "/root/.ipa_cache"
state: absent state: absent
when: result_ipareplica_enable_ipa.changed when: result_ipareplica_enable_ipa.changed
always: always:
- name: Cleanup temporary files - name: Cleanup temporary files
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
with_items: with_items:

View File

@@ -2,7 +2,7 @@
# tasks file for ipareplica # tasks file for ipareplica
- name: Import variables specific to distribution - name: Import variables specific to distribution
include_vars: "{{ item }}" ansible.builtin.include_vars: "{{ item }}"
with_first_found: with_first_found:
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
@@ -17,9 +17,9 @@
- "vars/default.yml" - "vars/default.yml"
- name: Install IPA replica - name: Install IPA replica
include_tasks: install.yml ansible.builtin.include_tasks: install.yml
when: state|default('present') == 'present' when: state|default('present') == 'present'
- name: Uninstall IPA replica - name: Uninstall IPA replica
include_tasks: uninstall.yml ansible.builtin.include_tasks: uninstall.yml
when: state|default('present') == 'absent' when: state|default('present') == 'absent'

View File

@@ -2,7 +2,7 @@
# tasks to uninstall IPA replica # tasks to uninstall IPA replica
- name: Uninstall - Uninstall IPA replica - name: Uninstall - Uninstall IPA replica
command: > ansible.builtin.command: >
/usr/sbin/ipa-server-install /usr/sbin/ipa-server-install
--uninstall --uninstall
-U -U
@@ -22,7 +22,7 @@
delay: 1 delay: 1
#- name: Uninstall - Remove all replication agreements and data about replica #- name: Uninstall - Remove all replication agreements and data about replica
# command: > # ansible.builtin.command: >
# /usr/sbin/ipa-replica-manage # /usr/sbin/ipa-replica-manage
# del # del
# {{ ipareplica_hostname | default(ansible_facts['fqdn']) }} # {{ ipareplica_hostname | default(ansible_facts['fqdn']) }}
@@ -32,6 +32,6 @@
# delegate_to: "{{ groups.ipaserver[0] | default(fail) }}" # delegate_to: "{{ groups.ipaserver[0] | default(fail) }}"
#- name: Remove IPA replica packages #- name: Remove IPA replica packages
# package: # ansible.builtin.package:
# name: "{{ ipareplica_packages }}" # name: "{{ ipareplica_packages }}"
# state: absent # state: absent

View File

@@ -1,14 +1,14 @@
--- ---
- name: Install - Initialize ipaserver_external_cert_files - name: Install - Initialize ipaserver_external_cert_files
set_fact: ansible.builtin.set_fact:
ipaserver_external_cert_files: [] ipaserver_external_cert_files: []
when: ipaserver_external_cert_files is undefined when: ipaserver_external_cert_files is undefined
- name: Install - Copy "{{ item }}" "{{ inventory_hostname }}':/root/'{{ item | basename }}" - name: Install - Copy "{{ item }}" "{{ inventory_hostname }}':/root/'{{ item | basename }}"
copy: ansible.builtin.copy:
src: "{{ item }}" src: "{{ item }}"
dest: "/root/{{ item | basename }}" dest: "/root/{{ item | basename }}"
mode: preserve mode: preserve
force: yes force: yes
- name: Install - Extend ipaserver_external_cert_files with "/root/{{ item | basename }}" - name: Install - Extend ipaserver_external_cert_files with "/root/{{ item | basename }}"
set_fact: ansible.builtin.set_fact:
ipaserver_external_cert_files: "{{ ipaserver_external_cert_files + [ '/root/' + (item | basename) ] }}" ipaserver_external_cert_files: "{{ ipaserver_external_cert_files + [ '/root/' + (item | basename) ] }}"

View File

@@ -3,24 +3,24 @@
- block: - block:
- name: Install - Ensure that IPA server packages are installed - name: Install - Ensure that IPA server packages are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages }}" name: "{{ ipaserver_packages }}"
state: present state: present
- name: Install - Ensure that IPA server packages for dns are installed - name: Install - Ensure that IPA server packages for dns are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages_dns }}" name: "{{ ipaserver_packages_dns }}"
state: present state: present
when: ipaserver_setup_dns | bool when: ipaserver_setup_dns | bool
- name: Install - Ensure that IPA server packages for adtrust are installed - name: Install - Ensure that IPA server packages for adtrust are installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages_adtrust }}" name: "{{ ipaserver_packages_adtrust }}"
state: present state: present
when: ipaserver_setup_adtrust | bool when: ipaserver_setup_adtrust | bool
- name: Install - Ensure that firewall packages installed - name: Install - Ensure that firewall packages installed
package: ansible.builtin.package:
name: "{{ ipaserver_packages_firewalld }}" name: "{{ ipaserver_packages_firewalld }}"
state: present state: present
when: ipaserver_setup_firewalld | bool when: ipaserver_setup_firewalld | bool
@@ -29,20 +29,20 @@
- block: - block:
- name: Firewalld service - Ensure that firewalld is running - name: Firewalld service - Ensure that firewalld is running
systemd: ansible.builtin.systemd:
name: firewalld name: firewalld
enabled: yes enabled: yes
state: started state: started
- name: Firewalld - Verify runtime zone "{{ ipaserver_firewalld_zone }}" - name: Firewalld - Verify runtime zone "{{ ipaserver_firewalld_zone }}"
shell: > ansible.builtin.shell: >
firewall-cmd firewall-cmd
--info-zone="{{ ipaserver_firewalld_zone }}" --info-zone="{{ ipaserver_firewalld_zone }}"
>/dev/null >/dev/null
when: ipaserver_firewalld_zone is defined when: ipaserver_firewalld_zone is defined
- name: Firewalld - Verify permanent zone "{{ ipaserver_firewalld_zone }}" - name: Firewalld - Verify permanent zone "{{ ipaserver_firewalld_zone }}"
shell: > ansible.builtin.shell: >
firewall-cmd firewall-cmd
--permanent --permanent
--info-zone="{{ ipaserver_firewalld_zone }}" --info-zone="{{ ipaserver_firewalld_zone }}"
@@ -51,7 +51,7 @@
when: ipaserver_setup_firewalld | bool when: ipaserver_setup_firewalld | bool
- include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml"
with_items: "{{ ipaserver_external_cert_files_from_controller }}" with_items: "{{ ipaserver_external_cert_files_from_controller }}"
when: ipaserver_external_cert_files_from_controller is defined and when: ipaserver_external_cert_files_from_controller is defined and
ipaserver_external_cert_files_from_controller|length > 0 and ipaserver_external_cert_files_from_controller|length > 0 and
@@ -144,7 +144,7 @@
- name: Install - Use new master password - name: Install - Use new master password
no_log: yes no_log: yes
set_fact: ansible.builtin.set_fact:
ipaserver_master_password: ipaserver_master_password:
"{{ result_ipaserver_master_password.password }}" "{{ result_ipaserver_master_password.password }}"
@@ -308,7 +308,7 @@
register: result_ipaserver_setup_ca register: result_ipaserver_setup_ca
- name: Copy /root/ipa.csr to "{{ inventory_hostname }}-ipa.csr" - name: Copy /root/ipa.csr to "{{ inventory_hostname }}-ipa.csr"
fetch: ansible.builtin.fetch:
src: /root/ipa.csr src: /root/ipa.csr
dest: "{{ inventory_hostname }}-ipa.csr" dest: "{{ inventory_hostname }}-ipa.csr"
flat: yes flat: yes
@@ -416,7 +416,7 @@
_dirsrv_pkcs12_info: "{{ result_ipaserver_test._dirsrv_pkcs12_info if result_ipaserver_test._dirsrv_pkcs12_info != None else omit }}" _dirsrv_pkcs12_info: "{{ result_ipaserver_test._dirsrv_pkcs12_info if result_ipaserver_test._dirsrv_pkcs12_info != None else omit }}"
- name: Install - Setup client - name: Install - Setup client
include_role: ansible.builtin.include_role:
name: ipaclient name: ipaclient
vars: vars:
state: present state: present
@@ -438,13 +438,13 @@
register: result_ipaserver_enable_ipa register: result_ipaserver_enable_ipa
- name: Install - Cleanup root IPA cache - name: Install - Cleanup root IPA cache
file: ansible.builtin.file:
path: "/root/.ipa_cache" path: "/root/.ipa_cache"
state: absent state: absent
when: result_ipaserver_enable_ipa.changed when: result_ipaserver_enable_ipa.changed
- name: Install - Configure firewalld - name: Install - Configure firewalld
command: > ansible.builtin.command: >
firewall-cmd firewall-cmd
--permanent --permanent
--zone="{{ ipaserver_firewalld_zone if ipaserver_firewalld_zone is --zone="{{ ipaserver_firewalld_zone if ipaserver_firewalld_zone is
@@ -458,7 +458,7 @@
when: ipaserver_setup_firewalld | bool when: ipaserver_setup_firewalld | bool
- name: Install - Configure firewalld runtime - name: Install - Configure firewalld runtime
command: > ansible.builtin.command: >
firewall-cmd firewall-cmd
--zone="{{ ipaserver_firewalld_zone if ipaserver_firewalld_zone is --zone="{{ ipaserver_firewalld_zone if ipaserver_firewalld_zone is
defined else '' }}" defined else '' }}"
@@ -474,7 +474,7 @@
always: always:
- name: Cleanup temporary files - name: Cleanup temporary files
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
with_items: with_items:

View File

@@ -2,7 +2,7 @@
# tasks file for ipaserver # tasks file for ipaserver
- name: Import variables specific to distribution - name: Import variables specific to distribution
include_vars: "{{ item }}" ansible.builtin.include_vars: "{{ item }}"
with_first_found: with_first_found:
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml" - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" - "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
@@ -17,9 +17,9 @@
- "vars/default.yml" - "vars/default.yml"
- name: Install IPA server - name: Install IPA server
include_tasks: install.yml ansible.builtin.include_tasks: install.yml
when: state|default('present') == 'present' when: state|default('present') == 'present'
- name: Uninstall IPA server - name: Uninstall IPA server
include_tasks: uninstall.yml ansible.builtin.include_tasks: uninstall.yml
when: state|default('present') == 'absent' when: state|default('present') == 'absent'

View File

@@ -2,7 +2,7 @@
# tasks to uninstall IPA server # tasks to uninstall IPA server
- name: Uninstall - Uninstall IPA server - name: Uninstall - Uninstall IPA server
command: > ansible.builtin.command: >
/usr/sbin/ipa-server-install /usr/sbin/ipa-server-install
--uninstall --uninstall
-U -U
@@ -15,6 +15,6 @@
changed_when: uninstall.rc == 0 changed_when: uninstall.rc == 0
#- name: Remove IPA server packages #- name: Remove IPA server packages
# package: # ansible.builtin.package:
# name: "{{ ipaserver_packages }}" # name: "{{ ipaserver_packages }}"
# state: absent # state: absent

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -28,13 +28,13 @@
# in upstream CI. # in upstream CI.
- name: Test automember using client context, in client host. - name: Test automember using client context, in client host.
import_playbook: test_automember.yml ansible.builtin.import_playbook: test_automember.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test automember using client context, in server host. - name: Test automember using client context, in server host.
import_playbook: test_automember.yml ansible.builtin.import_playbook: test_automember.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -8,7 +8,7 @@
# SET FACTS # SET FACTS
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] |
join ('.') }}" join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -8,7 +8,7 @@
# SET FACTS # SET FACTS
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] |
join ('.') }}" join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -29,13 +29,13 @@
# in upstream CI. # in upstream CI.
- name: Test automountlocation using client context, in client host. - name: Test automountlocation using client context, in client host.
import_playbook: test_automountkey.yml ansible.builtin.import_playbook: test_automountkey.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test automountlocation using client context, in server host. - name: Test automountlocation using client context, in server host.
import_playbook: test_automountkey.yml ansible.builtin.import_playbook: test_automountkey.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test automountlocation using client context, in client host. - name: Test automountlocation using client context, in client host.
import_playbook: test_automountlocation.yml ansible.builtin.import_playbook: test_automountlocation.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test automountlocation using client context, in server host. - name: Test automountlocation using client context, in server host.
import_playbook: test_automountlocation.yml ansible.builtin.import_playbook: test_automountlocation.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -28,13 +28,13 @@
# in upstream CI. # in upstream CI.
- name: Test automountmap using client context, in client host. - name: Test automountmap using client context, in client host.
import_playbook: test_automountmap.yml ansible.builtin.import_playbook: test_automountmap.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test automountmap using client context, in server host. - name: Test automountmap using client context, in server host.
import_playbook: test_automountmap.yml ansible.builtin.import_playbook: test_automountmap.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -5,7 +5,7 @@
tasks: tasks:
- name: Run generate-certificates.sh - name: Run generate-certificates.sh
command: > ansible.builtin.command: >
/bin/bash /bin/bash
generate-certificates.sh delete "{{ item }}" generate-certificates.sh delete "{{ item }}"
args: args:

View File

@@ -5,7 +5,7 @@
tasks: tasks:
- name: Run generate-certificates.sh - name: Run generate-certificates.sh
command: > ansible.builtin.command: >
/bin/bash /bin/bash
generate-certificates.sh create generate-certificates.sh create
"{{ groups.ipareplicas[0] }}" "{{ groups.ipareplicas[0] }}"
@@ -40,18 +40,18 @@
pre_tasks: pre_tasks:
- name: Remove "/root/ca-less-test" - name: Remove "/root/ca-less-test"
file: ansible.builtin.file:
path: "/root/ca-less-test" path: "/root/ca-less-test"
state: absent state: absent
- name: Generate "/root/ca-less-test" - name: Generate "/root/ca-less-test"
file: ansible.builtin.file:
path: "/root/ca-less-test" path: "/root/ca-less-test"
state: directory state: directory
mode: 0775 mode: 0775
- name: Copy CA certificate - name: Copy CA certificate
copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/certificates/root-ca/cert.pem" src: "{{ playbook_dir }}/certificates/root-ca/cert.pem"
dest: "/root/ca-less-test/ca.crt" dest: "/root/ca-less-test/ca.crt"
owner: root owner: root
@@ -59,7 +59,7 @@
mode: "0644" mode: "0644"
- name: Copy p12 certificates - name: Copy p12 certificates
copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/certificates/{{ item }}/{{ groups.ipareplicas[0] }}/cert.p12" src: "{{ playbook_dir }}/certificates/{{ item }}/{{ groups.ipareplicas[0] }}/cert.p12"
dest: "/root/ca-less-test/{{ item }}.p12" dest: "/root/ca-less-test/{{ item }}.p12"
owner: root owner: root
@@ -76,7 +76,7 @@
post_tasks: post_tasks:
- name: Fix KDC certificate permissions - name: Fix KDC certificate permissions
file: ansible.builtin.file:
path: /var/kerberos/krb5kdc/kdc.crt path: /var/kerberos/krb5kdc/kdc.crt
owner: root owner: root
group: root group: root

View File

@@ -5,7 +5,7 @@
tasks: tasks:
- name: Run generate-certificates.sh - name: Run generate-certificates.sh
command: > ansible.builtin.command: >
/bin/bash /bin/bash
generate-certificates.sh create generate-certificates.sh create
"{{ groups.ipaserver[0] }}" "{{ groups.ipaserver[0] }}"
@@ -40,18 +40,18 @@
pre_tasks: pre_tasks:
- name: Remove "/root/ca-less-test" - name: Remove "/root/ca-less-test"
file: ansible.builtin.file:
path: "/root/ca-less-test" path: "/root/ca-less-test"
state: absent state: absent
- name: Generate "/root/ca-less-test" - name: Generate "/root/ca-less-test"
file: ansible.builtin.file:
path: "/root/ca-less-test" path: "/root/ca-less-test"
state: directory state: directory
mode: 0775 mode: 0775
- name: Copy CA certificate - name: Copy CA certificate
copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/certificates/root-ca/cert.pem" src: "{{ playbook_dir }}/certificates/root-ca/cert.pem"
dest: "/root/ca-less-test/ca.crt" dest: "/root/ca-less-test/ca.crt"
owner: root owner: root
@@ -59,7 +59,7 @@
mode: "0644" mode: "0644"
- name: Copy p12 certificates - name: Copy p12 certificates
copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/certificates/{{ item }}/{{ groups.ipaserver[0] }}/cert.p12" src: "{{ playbook_dir }}/certificates/{{ item }}/{{ groups.ipaserver[0] }}/cert.p12"
dest: "/root/ca-less-test/{{ item }}.p12" dest: "/root/ca-less-test/{{ item }}.p12"
owner: root owner: root

View File

@@ -5,7 +5,7 @@
gather_facts: false gather_facts: false
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- block: - block:
# Retrieve current configuration. # Retrieve current configuration.
@@ -16,7 +16,7 @@
register: previousconfig register: previousconfig
- name: Display current configuration. - name: Display current configuration.
debug: ansible.builtin.debug:
var: previousconfig var: previousconfig
# setup environment. # setup environment.
@@ -481,7 +481,7 @@
register: result register: result
- name: "CA-Renewal server warning." - name: "CA-Renewal server warning."
debug: ansible.builtin.debug:
msg: "Due to a test failure, IPA CA-Renewal Server might not be correctly be set. Check your configuration." msg: "Due to a test failure, IPA CA-Renewal Server might not be correctly be set. Check your configuration."
always: always:

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -26,13 +26,13 @@
# in upstream CI. # in upstream CI.
- name: Test config using client context, in client host. - name: Test config using client context, in client host.
import_playbook: test_config.yml ansible.builtin.import_playbook: test_config.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test config using client context, in server host. - name: Test config using client context, in server host.
import_playbook: test_config.yml ansible.builtin.import_playbook: test_config.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -7,7 +7,7 @@
tasks: tasks:
- name: Set FreeIPA facts. - name: Set FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# GET CURRENT CONFIG # GET CURRENT CONFIG

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test delegation using client context, in client host. - name: Test delegation using client context, in client host.
import_playbook: test_delegation.yml ansible.builtin.import_playbook: test_delegation.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test delegation using client context, in server host. - name: Test delegation using client context, in server host.
import_playbook: test_delegation.yml ansible.builtin.import_playbook: test_delegation.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test dnsconfig using client context, in client host. - name: Test dnsconfig using client context, in client host.
import_playbook: test_dnsconfig.yml ansible.builtin.import_playbook: test_dnsconfig.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test dnsconfig using client context, in server host. - name: Test dnsconfig using client context, in server host.
import_playbook: test_dnsconfig.yml ansible.builtin.import_playbook: test_dnsconfig.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test dnsforwardzone using client context, in client host. - name: Test dnsforwardzone using client context, in client host.
import_playbook: test_dnsforwardzone.yml ansible.builtin.import_playbook: test_dnsforwardzone.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test dnsforwardzone using client context, in server host. - name: Test dnsforwardzone using client context, in server host.
import_playbook: test_dnsforwardzone.yml ansible.builtin.import_playbook: test_dnsforwardzone.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -1,10 +1,10 @@
--- ---
- name: Setup variables and facts. - name: Setup variables and facts.
include_tasks: env_vars.yml ansible.builtin.include_tasks: env_vars.yml
# Cleanup before setup. # Cleanup before setup.
- name: Cleanup test environment. - name: Cleanup test environment.
include_tasks: env_cleanup.yml ansible.builtin.include_tasks: env_cleanup.yml
# Common setup tasks. # Common setup tasks.
- name: Ensure DNS testing zones are present. - name: Ensure DNS testing zones are present.

View File

@@ -1,7 +1,7 @@
--- ---
# Set common vars and facts for test. # Set common vars and facts for test.
- name: Set IPv4 address prefix. - name: Set IPv4 address prefix.
set_fact: ansible.builtin.set_fact:
ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] |
join('.') }}" join('.') }}"
ipv4_reverse: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | ipv4_reverse: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] |
@@ -9,7 +9,7 @@
join('.') }}" join('.') }}"
- name: Set zone prefixes. - name: Set zone prefixes.
set_fact: ansible.builtin.set_fact:
testzone: 'testzone.test' testzone: 'testzone.test'
safezone: 'safezone.test' safezone: 'safezone.test'
zone_ipv6_reverse: "ip6.arpa." zone_ipv6_reverse: "ip6.arpa."

View File

@@ -7,10 +7,10 @@
tasks: tasks:
- name: Setup testing environment. - name: Setup testing environment.
include_tasks: env_setup.yml ansible.builtin.include_tasks: env_setup.yml
- name: Generate self-signed certificates. - name: Generate self-signed certificates.
shell: ansible.builtin.shell:
cmd: | cmd: |
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test' openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der" openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
@@ -1547,7 +1547,7 @@
# cleanup # cleanup
- name: Cleanup test environment. - name: Cleanup test environment.
include_tasks: env_cleanup.yml ansible.builtin.include_tasks: env_cleanup.yml
- name: Remove certificate files. # noqa: deprecated-command-syntax - name: Remove certificate files. # noqa: deprecated-command-syntax
ansible.builtin.shell: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64" ansible.builtin.shell: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test dnsrecord using client context, in client host. - name: Test dnsrecord using client context, in client host.
import_playbook: test_dnsrecord.yml ansible.builtin.import_playbook: test_dnsrecord.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test dnsrecord using client context, in server host. - name: Test dnsrecord using client context, in server host.
import_playbook: test_dnsrecord.yml ansible.builtin.import_playbook: test_dnsrecord.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -7,7 +7,7 @@
tasks: tasks:
- name: Setup test environment - name: Setup test environment
include_tasks: env_setup.yml ansible.builtin.include_tasks: env_setup.yml
# tests # tests
@@ -147,4 +147,4 @@
# Cleanup # Cleanup
- name: Cleanup test environment. - name: Cleanup test environment.
include_tasks: env_cleanup.yml ansible.builtin.include_tasks: env_cleanup.yml

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Setup testing environment. - name: Setup testing environment.
include_tasks: env_setup.yml ansible.builtin.include_tasks: env_setup.yml
- name: Add test host. - name: Add test host.
ipahost: ipahost:
@@ -177,4 +177,4 @@
state: absent state: absent
# cleanup # cleanup
- name: Cleanup test environment. - name: Cleanup test environment.
include_tasks: env_cleanup.yml ansible.builtin.include_tasks: env_cleanup.yml

View File

@@ -1,3 +1,3 @@
--- ---
- name: Cleanup test environment. - name: Cleanup test environment.
include_tasks: env_cleanup.yml ansible.builtin.include_tasks: env_cleanup.yml

View File

@@ -1,3 +1,3 @@
--- ---
- name: Cleanup test environment. - name: Cleanup test environment.
include_tasks: env_cleanup.yml ansible.builtin.include_tasks: env_cleanup.yml

View File

@@ -8,7 +8,7 @@
# Setup # Setup
- name: Setup testing environment - name: Setup testing environment
include_tasks: env_setup.yml ansible.builtin.include_tasks: env_setup.yml
# Tests # Tests
- name: Check if zone is present, when in shouldn't be. - name: Check if zone is present, when in shouldn't be.
@@ -267,4 +267,4 @@
# Teardown # Teardown
- name: Teardown testing environment - name: Teardown testing environment
include_tasks: env_teardown.yml ansible.builtin.include_tasks: env_teardown.yml

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test dnszone using client context, in client host. - name: Test dnszone using client context, in client host.
import_playbook: test_dnszone.yml ansible.builtin.import_playbook: test_dnszone.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test dnszone using client context, in server host. - name: Test dnszone using client context, in server host.
import_playbook: test_dnszone.yml ansible.builtin.import_playbook: test_dnszone.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -8,7 +8,7 @@
# Setup # Setup
- name: Setup testing environment - name: Setup testing environment
include_tasks: env_setup.yml ansible.builtin.include_tasks: env_setup.yml
- name: Ensure zone is present. - name: Ensure zone is present.
ipadnszone: ipadnszone:
@@ -291,4 +291,4 @@
# Teardown # Teardown
- name: Teardown testing environment - name: Teardown testing environment
include_tasks: env_teardown.yml ansible.builtin.include_tasks: env_teardown.yml

View File

@@ -8,7 +8,7 @@
# Setup # Setup
- name: Setup testing environment - name: Setup testing environment
include_tasks: env_setup.yml ansible.builtin.include_tasks: env_setup.yml
# Tests # Tests
- name: Ensure zone exists for reverse IP. - name: Ensure zone exists for reverse IP.
@@ -55,7 +55,7 @@
register: ipv6_zone register: ipv6_zone
failed_when: not ipv6_zone.changed or ipv6_zone.failed failed_when: not ipv6_zone.changed or ipv6_zone.failed
# - debug: # - ansible.builtin.debug:
# msg: "{{ipv6_zone}}" # msg: "{{ipv6_zone}}"
- name: Ensure ipv6 zone was created. - name: Ensure ipv6 zone was created.
@@ -95,4 +95,4 @@
# Teardown # Teardown
- name: Teardown testing environment - name: Teardown testing environment
include_tasks: env_teardown.yml ansible.builtin.include_tasks: env_teardown.yml

View File

@@ -8,12 +8,12 @@
# #
--- ---
- name: Retrieving FreeIPA version. - name: Retrieving FreeIPA version.
shell: ansible.builtin.shell:
cmd: 'ipa --version | sed -n "s/VERSION: \([^,]*\).*API_VERSION: \([^,]*\).*/\1\\n\2/p"' cmd: 'ipa --version | sed -n "s/VERSION: \([^,]*\).*API_VERSION: \([^,]*\).*/\1\\n\2/p"'
register: ipa_cmd_version register: ipa_cmd_version
- name: Verify if host is an IPA server or client. - name: Verify if host is an IPA server or client.
shell: ansible.builtin.shell:
cmd: | cmd: |
echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin echo SomeADMINpassword | kinit -c {{ krb5ccname }} admin
RESULT=$(KRB5CCNAME={{ krb5ccname }} ipa server-show `hostname` && echo SERVER || echo CLIENT) RESULT=$(KRB5CCNAME={{ krb5ccname }} ipa server-show `hostname` && echo SERVER || echo CLIENT)
@@ -24,7 +24,7 @@
register: output register: output
- name: Set FreeIPA facts. - name: Set FreeIPA facts.
set_fact: ansible.builtin.set_fact:
ipa_version: "{{ ipa_cmd_version.stdout_lines[0] }}" ipa_version: "{{ ipa_cmd_version.stdout_lines[0] }}"
ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}" ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}"
ipa_host_is_client: "{{ (output.stdout_lines[-1] == 'CLIENT') | bool }}" ipa_host_is_client: "{{ (output.stdout_lines[-1] == 'CLIENT') | bool }}"
@@ -32,12 +32,12 @@
- block: - block:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: "'fqdn' in ansible_facts" when: "'fqdn' in ansible_facts"
- name: Set Domain to 'ipa.test' if FQDN could not be retrieved. - name: Set Domain to 'ipa.test' if FQDN could not be retrieved.
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "ipa.test" ipaserver_domain: "ipa.test"
when: "'fqdn' not in ansible_facts" when: "'fqdn' not in ansible_facts"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -15,7 +15,7 @@
tasks: tasks:
- name: Run external-ca.sh - name: Run external-ca.sh
command: > ansible.builtin.command: >
/bin/bash /bin/bash
external-ca.sh external-ca.sh
"{{ groups.ipaserver[0] }}" "{{ groups.ipaserver[0] }}"

View File

@@ -11,7 +11,7 @@
post_tasks: post_tasks:
- name: Copy CSR /root/ipa.csr from node to "{{ groups.ipaserver[0] + '-ipa.csr' }}" - name: Copy CSR /root/ipa.csr from node to "{{ groups.ipaserver[0] + '-ipa.csr' }}"
fetch: ansible.builtin.fetch:
src: /root/ipa.csr src: /root/ipa.csr
dest: "{{ groups.ipaserver[0] + '-ipa.csr' }}" dest: "{{ groups.ipaserver[0] + '-ipa.csr' }}"
flat: yes flat: yes
@@ -21,7 +21,7 @@
tasks: tasks:
- name: Run external-ca.sh - name: Run external-ca.sh
command: > ansible.builtin.command: >
/bin/bash /bin/bash
external-ca.sh external-ca.sh
"{{ groups.ipaserver[0] }}" "{{ groups.ipaserver[0] }}"
@@ -38,7 +38,7 @@
pre_tasks: pre_tasks:
- name: Copy "{{ groups.ipaserver[0] + '-chain.crt' }}" to /root/chain.crt on node - name: Copy "{{ groups.ipaserver[0] + '-chain.crt' }}" to /root/chain.crt on node
copy: ansible.builtin.copy:
src: "{{ groups.ipaserver[0] + '-chain.crt' }}" src: "{{ groups.ipaserver[0] + '-chain.crt' }}"
dest: "/root/chain.crt" dest: "/root/chain.crt"
force: yes force: yes

View File

@@ -6,12 +6,12 @@
tasks: tasks:
# setup # setup
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# GET FQDN_AT_DOMAIN # GET FQDN_AT_DOMAIN
- name: Get fqdn_at_domain - name: Get fqdn_at_domain
set_fact: ansible.builtin.set_fact:
fqdn_at_domain: "{{ ansible_facts['fqdn'] + '@' + ipaserver_realm }}" fqdn_at_domain: "{{ ansible_facts['fqdn'] + '@' + ipaserver_realm }}"
# CLEANUP TEST ITEMS # CLEANUP TEST ITEMS

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test group using client context, in client host. - name: Test group using client context, in client host.
import_playbook: test_group.yml ansible.builtin.import_playbook: test_group.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test group using client context, in server host. - name: Test group using client context, in server host.
import_playbook: test_group.yml ansible.builtin.import_playbook: test_group.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- block: - block:

View File

@@ -9,11 +9,11 @@
ad_domain: "{{ test_ad_domain | default('ad.ipa.test') }}" ad_domain: "{{ test_ad_domain | default('ad.ipa.test') }}"
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- block: - block:
- name: Create idoverrideuser. - name: Create idoverrideuser.
shell: | ansible.builtin.shell: |
kinit -c idoverride_cache admin <<< SomeADMINpassword kinit -c idoverride_cache admin <<< SomeADMINpassword
ipa idoverrideuser-add "Default Trust View" {{ ad_user }} ipa idoverrideuser-add "Default Trust View" {{ ad_user }}
kdestroy -A -q -c idoverride_cache kdestroy -A -q -c idoverride_cache
@@ -95,7 +95,7 @@
always: always:
- name: Remove idoverrideuser. - name: Remove idoverrideuser.
shell: | ansible.builtin.shell: |
kinit -c idoverride_cache admin <<< SomeADMINpassword kinit -c idoverride_cache admin <<< SomeADMINpassword
ipa idoverrideuser-del "Default Trust View" {{ ad_user }} ipa idoverrideuser-del "Default Trust View" {{ ad_user }}
kdestroy -A -q -c idoverride_cache kdestroy -A -q -c idoverride_cache

View File

@@ -5,7 +5,7 @@
gather_facts: false gather_facts: false
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- name: Tests requiring IPA version 4.8.4+ - name: Tests requiring IPA version 4.8.4+
block: block:

View File

@@ -5,7 +5,7 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test hbacrule using client context, in client host. - name: Test hbacrule using client context, in client host.
import_playbook: test_hbacrule.yml ansible.builtin.import_playbook: test_hbacrule.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test hbacrule using client context, in server host. - name: Test hbacrule using client context, in server host.
import_playbook: test_hbacrule.yml ansible.builtin.import_playbook: test_hbacrule.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -25,7 +25,7 @@
- sVCgrOUp1 - sVCgrOUp1
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- block: - block:
# setup # setup

View File

@@ -5,7 +5,7 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test hbacsvc using client context, in client host. - name: Test hbacsvc using client context, in client host.
import_playbook: test_hbacsvc.yml ansible.builtin.import_playbook: test_hbacsvc.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test hbacsvc using client context, in server host. - name: Test hbacsvc using client context, in server host.
import_playbook: test_hbacsvc.yml ansible.builtin.import_playbook: test_hbacsvc.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test hbacsvcgroup using client context, in client host. - name: Test hbacsvcgroup using client context, in client host.
import_playbook: test_hbacsvcgroup.yml ansible.builtin.import_playbook: test_hbacsvcgroup.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test hbacsvcgroup using client context, in server host. - name: Test hbacsvcgroup using client context, in server host.
import_playbook: test_hbacsvcgroup.yml ansible.builtin.import_playbook: test_hbacsvcgroup.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Generate self-signed certificates. - name: Generate self-signed certificates.
shell: ansible.builtin.shell:
cmd: | cmd: |
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test' openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der" openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
@@ -100,7 +100,7 @@
failed_when: result.changed or result.failed failed_when: result.changed or result.failed
- name: Remove certificate files. # noqa: deprecated-command-syntax - name: Remove certificate files. # noqa: deprecated-command-syntax
shell: ansible.builtin.shell:
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64" cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
with_items: [1, 2, 3] with_items: [1, 2, 3]
become: no become: no

View File

@@ -5,7 +5,7 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
@@ -26,7 +26,7 @@
failed_when: not result.changed or result.failed failed_when: not result.changed or result.failed
- name: Generate self-signed certificates. - name: Generate self-signed certificates.
shell: ansible.builtin.shell:
cmd: | cmd: |
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test' openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der" openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
@@ -99,7 +99,7 @@
failed_when: not result.changed or result.failed failed_when: not result.changed or result.failed
- name: Remove certificate files. # noqa: deprecated-command-syntax - name: Remove certificate files. # noqa: deprecated-command-syntax
shell: ansible.builtin.shell:
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64" cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
with_items: [1, 2, 3] with_items: [1, 2, 3]
become: no become: no

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host6_fqdn - name: Set host1_fqdn .. host6_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"
@@ -33,7 +33,7 @@
state: absent state: absent
- name: Get IPv4 address prefix from server node - name: Get IPv4 address prefix from server node
set_fact: ansible.builtin.set_fact:
ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] |
join('.') }}" join('.') }}"

View File

@@ -5,17 +5,17 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Get Realm from server name - name: Get Realm from server name
set_fact: ansible.builtin.set_fact:
ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}"
when: ipaserver_realm is not defined when: ipaserver_realm is not defined
- name: Set host1_fqdn .. host3_fqdn - name: Set host1_fqdn .. host3_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"

View File

@@ -5,17 +5,17 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Get Realm from server name - name: Get Realm from server name
set_fact: ansible.builtin.set_fact:
ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}"
when: ipaserver_realm is not defined when: ipaserver_realm is not defined
- name: Set host1_fqdn .. host3_fqdn - name: Set host1_fqdn .. host3_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host6_fqdn - name: Set host1_fqdn .. host6_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
- name: Host absent - name: Host absent

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test automember using client context, in client host. - name: Test automember using client context, in client host.
import_playbook: test_host.yml ansible.builtin.import_playbook: test_host.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test automember using client context, in server host. - name: Test automember using client context, in server host.
import_playbook: test_host.yml ansible.builtin.import_playbook: test_host.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,12 +6,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host6_fqdn - name: Set host1_fqdn .. host6_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
# CLEANUP TEST ITEMS # CLEANUP TEST ITEMS

View File

@@ -5,18 +5,18 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host6_fqdn - name: Set host1_fqdn .. host6_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"
- name: Get IPv4 address prefix from server node - name: Get IPv4 address prefix from server node
set_fact: ansible.builtin.set_fact:
ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] |
join('.') }}" join('.') }}"

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host2_fqdn - name: Set host1_fqdn .. host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"

View File

@@ -5,17 +5,17 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Get Realm from server name - name: Get Realm from server name
set_fact: ansible.builtin.set_fact:
ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}"
when: ipaserver_realm is not defined when: ipaserver_realm is not defined
- name: Set host1_fqdn - name: Set host1_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
- name: Host host1 absent - name: Host host1 absent

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn and host2_fqdn - name: Set host1_fqdn and host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
@@ -34,12 +34,12 @@
failed_when: not ipahost.changed or ipahost.failed failed_when: not ipahost.changed or ipahost.failed
- name: Assert ipahost.host.randompassword is defined. - name: Assert ipahost.host.randompassword is defined.
assert: ansible.builtin.assert:
that: that:
- ipahost.host.randompassword is defined - ipahost.host.randompassword is defined
- name: Print generated random password - name: Print generated random password
debug: ansible.builtin.debug:
var: ipahost.host.randompassword var: ipahost.host.randompassword
- name: Host "{{ host1_fqdn }}" absent - name: Host "{{ host1_fqdn }}" absent
@@ -64,7 +64,7 @@
failed_when: not ipahost.changed or ipahost.failed failed_when: not ipahost.changed or ipahost.failed
- name: Assert randompassword is defined for host1 and host2. - name: Assert randompassword is defined for host1 and host2.
assert: ansible.builtin.assert:
that: that:
- ipahost.host["{{ host1_fqdn }}"].randompassword is - ipahost.host["{{ host1_fqdn }}"].randompassword is
defined defined
@@ -72,11 +72,11 @@
defined defined
- name: Print generated random password for "{{ host1_fqdn }}" - name: Print generated random password for "{{ host1_fqdn }}"
debug: ansible.builtin.debug:
var: ipahost.host["{{ host1_fqdn }}"].randompassword var: ipahost.host["{{ host1_fqdn }}"].randompassword
- name: Print generated random password for "{{ host2_fqdn }}" - name: Print generated random password for "{{ host2_fqdn }}"
debug: ansible.builtin.debug:
var: ipahost.host["{{ host2_fqdn }}"].randompassword var: ipahost.host["{{ host2_fqdn }}"].randompassword
- name: Enrolled host "{{ ansible_facts['fqdn'] }}" fails to set random password with update_password always - name: Enrolled host "{{ ansible_facts['fqdn'] }}" fails to set random password with update_password always
@@ -90,7 +90,7 @@
failed_when: ipahost.changed or not ipahost.failed failed_when: ipahost.changed or not ipahost.failed
- name: Assert randompassword is not defined for 'ansible_fqdn'. - name: Assert randompassword is not defined for 'ansible_fqdn'.
assert: ansible.builtin.assert:
that: that:
- ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is - ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is
not defined not defined

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn - name: Set host1_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
- name: Host absent - name: Host absent
@@ -22,12 +22,12 @@
state: absent state: absent
- name: Get IPv4 address prefix from server node - name: Get IPv4 address prefix from server node
set_fact: ansible.builtin.set_fact:
ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] |
join('.') }}" join('.') }}"
- name: Set zone prefixes. - name: Set zone prefixes.
set_fact: ansible.builtin.set_fact:
zone_ipv6_reverse: "ip6.arpa." zone_ipv6_reverse: "ip6.arpa."
zone_ipv6_reverse_workaround: "d.f.ip6.arpa." zone_ipv6_reverse_workaround: "d.f.ip6.arpa."
zone_prefix_reverse: "in-addr.arpa" zone_prefix_reverse: "in-addr.arpa"

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn - name: Set host1_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
- name: Host host1 absent - name: Host host1 absent

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host6_fqdn - name: Set host1_fqdn .. host6_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"

View File

@@ -5,12 +5,12 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host5_fqdn - name: Set host1_fqdn .. host5_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
host3_fqdn: "{{ 'host3.' + ipaserver_domain }}" host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"

View File

@@ -5,17 +5,17 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Get Realm from server name - name: Get Realm from server name
set_fact: ansible.builtin.set_fact:
ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}" ipaserver_realm: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') | upper }}"
when: ipaserver_realm is not defined when: ipaserver_realm is not defined
- name: Set host1_fqdn .. host2_fqdn - name: Set host1_fqdn .. host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test hostgroup using client context, in client host. - name: Test hostgroup using client context, in client host.
import_playbook: test_hostgroup.yml ansible.builtin.import_playbook: test_hostgroup.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test hostgroup using client context, in server host. - name: Test hostgroup using client context, in server host.
import_playbook: test_hostgroup.yml ansible.builtin.import_playbook: test_hostgroup.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -5,7 +5,7 @@
gather_facts: false gather_facts: false
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- name: Tests requiring IPA version 4.8.4+ - name: Tests requiring IPA version 4.8.4+
block: block:

View File

@@ -5,7 +5,7 @@
gather_facts: false gather_facts: false
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- name: Tests requiring IPA version 4.8.7+ - name: Tests requiring IPA version 4.8.7+
block: block:

View File

@@ -23,7 +23,7 @@
failed_when: result.failed failed_when: result.failed
- name: Retrieve Domain Security Identifier - name: Retrieve Domain Security Identifier
shell: ansible.builtin.shell:
cmd: | cmd: |
kinit -c test_krb5_cache admin <<< SomeADMINpassword > /dev/null kinit -c test_krb5_cache admin <<< SomeADMINpassword > /dev/null
KRB5CCNAME=test_krb5_cache ipa trust-show {{ adserver.domain }} | sed -n "/Domain Security Identifier/s/ //gp" | cut -d":" -f2 KRB5CCNAME=test_krb5_cache ipa trust-show {{ adserver.domain }} | sed -n "/Domain Security Identifier/s/ //gp" | cut -d":" -f2
@@ -32,5 +32,5 @@
no_log: yes no_log: yes
- name: Set ipa_domain_sid. - name: Set ipa_domain_sid.
set_fact: ansible.builtin.set_fact:
ipa_domain_sid: "{{ getsid.stdout }}" ipa_domain_sid: "{{ getsid.stdout }}"

View File

@@ -14,7 +14,7 @@
tasks: tasks:
# CLEANUP TEST ITEMS # CLEANUP TEST ITEMS
- name: Remove test trust. - name: Remove test trust.
include_tasks: tasks_remove_trust.yml ansible.builtin.include_tasks: tasks_remove_trust.yml
when: trust_test_is_supported | default(false) when: trust_test_is_supported | default(false)
- name: Ensure testing idranges are absent - name: Ensure testing idranges are absent
@@ -121,7 +121,7 @@
- block: - block:
# Create trust with range_type: ipa-ad-trust # Create trust with range_type: ipa-ad-trust
- name: Create trust with range_type 'ipa-ad-trust' - name: Create trust with range_type 'ipa-ad-trust'
include_tasks: tasks_set_trust.yml ansible.builtin.include_tasks: tasks_set_trust.yml
vars: vars:
trust_base_id: 10000000 trust_base_id: 10000000
trust_range_size: 200000 trust_range_size: 200000
@@ -218,7 +218,7 @@
# Remove trust and idrange # Remove trust and idrange
- name: Remove test trust. - name: Remove test trust.
include_tasks: tasks_remove_trust.yml ansible.builtin.include_tasks: tasks_remove_trust.yml
- name: Ensure AD-trust idrange is absent - name: Ensure AD-trust idrange is absent
ipaidrange: ipaidrange:
@@ -229,7 +229,7 @@
# Create trust with range_type: ipa-ad-trust-posix # Create trust with range_type: ipa-ad-trust-posix
- name: Create trust with range_type 'ipa-ad-trust' - name: Create trust with range_type 'ipa-ad-trust'
include_tasks: tasks_set_trust.yml ansible.builtin.include_tasks: tasks_set_trust.yml
vars: vars:
trust_base_id: 10000000 trust_base_id: 10000000
trust_range_size: 200000 trust_range_size: 200000
@@ -251,7 +251,7 @@
# Remove trust and idrange # Remove trust and idrange
- name: Remove test trust. - name: Remove test trust.
include_tasks: tasks_remove_trust.yml ansible.builtin.include_tasks: tasks_remove_trust.yml
- name: Ensure AD-trust idrange is absent - name: Ensure AD-trust idrange is absent
ipaidrange: ipaidrange:
@@ -262,7 +262,7 @@
# Remove trust and idrange # Remove trust and idrange
- name: Remove test trust. - name: Remove test trust.
include_tasks: tasks_remove_trust.yml ansible.builtin.include_tasks: tasks_remove_trust.yml
- name: Ensure AD-trust idrange is absent - name: Ensure AD-trust idrange is absent
ipaidrange: ipaidrange:
@@ -273,7 +273,7 @@
# Create trust with range_type: ipa-ad-trust-posix # Create trust with range_type: ipa-ad-trust-posix
- name: Create trust with range_type 'ipa-ad-trust-posix' - name: Create trust with range_type 'ipa-ad-trust-posix'
include_tasks: tasks_set_trust.yml ansible.builtin.include_tasks: tasks_set_trust.yml
vars: vars:
trust_base_id: 10000000 trust_base_id: 10000000
trust_range_size: 2000000 trust_range_size: 2000000
@@ -319,7 +319,7 @@
# Remove trust and idrange # Remove trust and idrange
- name: Remove test trust. - name: Remove test trust.
include_tasks: tasks_remove_trust.yml ansible.builtin.include_tasks: tasks_remove_trust.yml
- name: Ensure AD-trust idrange is absent - name: Ensure AD-trust idrange is absent
ipaidrange: ipaidrange:
@@ -330,7 +330,7 @@
# Create trust with range_type: ipa-ad-trust-posix # Create trust with range_type: ipa-ad-trust-posix
- name: Create trust with range_type 'ipa-ad-trust-posix' - name: Create trust with range_type 'ipa-ad-trust-posix'
include_tasks: tasks_set_trust.yml ansible.builtin.include_tasks: tasks_set_trust.yml
vars: vars:
trust_base_id: 10000000 trust_base_id: 10000000
trust_range_size: 2000000 trust_range_size: 2000000
@@ -352,7 +352,7 @@
always: always:
# CLEANUP TEST ITEMS # CLEANUP TEST ITEMS
- name: Remove test trust. - name: Remove test trust.
include_tasks: tasks_remove_trust.yml ansible.builtin.include_tasks: tasks_remove_trust.yml
- name: Ensure testing idranges are absent - name: Ensure testing idranges are absent
ipaidrange: ipaidrange:

View File

@@ -8,7 +8,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -29,11 +29,11 @@
# in upstream CI. # in upstream CI.
- name: Test idrange using client context, in client host. - name: Test idrange using client context, in client host.
import_playbook: test_idrange.yml ansible.builtin.import_playbook: test_idrange.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test idrange using client context, in server host. - name: Test idrange using client context, in server host.
import_playbook: test_idrange.yml ansible.builtin.import_playbook: test_idrange.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test location using client context, in client host. - name: Test location using client context, in client host.
import_playbook: test_location.yml ansible.builtin.import_playbook: test_location.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test location using client context, in server host. - name: Test location using client context, in server host.
import_playbook: test_location.yml ansible.builtin.import_playbook: test_location.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -19,7 +19,7 @@
# CREATE TEST ITEMS # CREATE TEST ITEMS
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,25 +27,25 @@
# in upstream CI. # in upstream CI.
- name: Test netgroup using client context, in client host. - name: Test netgroup using client context, in client host.
import_playbook: test_netgroup.yml ansible.builtin.import_playbook: test_netgroup.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test netgroup using client context, in server host. - name: Test netgroup using client context, in server host.
import_playbook: test_netgroup.yml ansible.builtin.import_playbook: test_netgroup.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client
- name: Test netgroup with member using client context, in client host. - name: Test netgroup with member using client context, in client host.
import_playbook: test_netgroup_member.yml ansible.builtin.import_playbook: test_netgroup_member.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test netgroup with member using client context, in server host. - name: Test netgroup with member using client context, in server host.
import_playbook: test_netgroup_member.yml ansible.builtin.import_playbook: test_netgroup_member.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -7,12 +7,12 @@
tasks: tasks:
- block: - block:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host2_fqdn - name: Set host1_fqdn .. host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"

View File

@@ -7,12 +7,12 @@
tasks: tasks:
- block: - block:
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
- name: Set host1_fqdn .. host2_fqdn - name: Set host1_fqdn .. host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"

View File

@@ -16,7 +16,7 @@
- block: - block:
# SETUP # SETUP
- name: Get Domain from server name - name: Get Domain from server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined
@@ -62,7 +62,7 @@
# TESTS # TESTS
- name: Start tests. - name: Start tests.
debug: ansible.builtin.debug:
msg: "Tests are starting." msg: "Tests are starting."
- name: Ensure netgroups exist - name: Ensure netgroups exist
@@ -203,7 +203,7 @@
failed_when: result.failed or result.changed failed_when: result.failed or result.changed
- name: End tests. - name: End tests.
debug: ansible.builtin.debug:
msg: "All tests executed." msg: "All tests executed."
always: always:

View File

@@ -4,7 +4,7 @@
become: true become: true
tasks: tasks:
- include_tasks: ../env_freeipa_facts.yml - ansible.builtin.include_tasks: ../env_freeipa_facts.yml
- name: Ensure testing groups are present. - name: Ensure testing groups are present.
ipagroup: ipagroup:

Some files were not shown because too many files have changed in this diff Show More