diff --git a/bigboot_rear_nfs_export.yml b/bigboot_rear_nfs_export.yml index e521e42..f3ae6be 100644 --- a/bigboot_rear_nfs_export.yml +++ b/bigboot_rear_nfs_export.yml @@ -1,6 +1,28 @@ --- -- name: Perform logical volume and boot parition resizing as needed +- name: Check SSH connectivity and create group of reachable hosts hosts: rear_server + gather_facts: false + become: true + + tasks: + - name: Check SSH connectivity + ansible.builtin.ping: + register: result + failed_when: false + + - name: Clear unreachable host errors + ansible.builtin.meta: clear_host_errors + + - name: Add reachable hosts to group + ansible.builtin.group_by: + key: reachable_hosts + when: + - result['ping'] is defined + - "'pong' in result['ping']" + + +- name: Update NFS exports on reachable servers + hosts: reachable_hosts become: true gather_facts: false @@ -8,6 +30,12 @@ - bigboot_vars.yml tasks: + - name: Grab the template name + ansible.builtin.set_stats: + data: + nfs_exports_template_name: "{{ tower_job_template_name }}" + aggregate: true + - name: Create IP list and add to NFS exports ansible.builtin.include_tasks: tasks/rear_nfs_exports.yml loop: "{{ bigboot_data | dict2items }}"