Check connectivity to NFS servers and update exports accordingly on those which succeed the connection

This commit is contained in:
Chris Hammer 2024-09-10 21:52:35 -04:00
parent 2bf5969f51
commit fde58e368d

View File

@ -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 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 become: true
gather_facts: false gather_facts: false
@ -8,6 +30,12 @@
- bigboot_vars.yml - bigboot_vars.yml
tasks: 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 - name: Create IP list and add to NFS exports
ansible.builtin.include_tasks: tasks/rear_nfs_exports.yml ansible.builtin.include_tasks: tasks/rear_nfs_exports.yml
loop: "{{ bigboot_data | dict2items }}" loop: "{{ bigboot_data | dict2items }}"