diff --git a/ansible/playbooks/role-rocky-kojid.yml b/ansible/playbooks/role-rocky-kojid.yml index fc03071..ae59a2a 100644 --- a/ansible/playbooks/role-rocky-kojid.yml +++ b/ansible/playbooks/role-rocky-kojid.yml @@ -28,13 +28,13 @@ - name: Check for keytabs - kojid stat: path: /etc/kojid.keytab - register: kojid_keytab + register: kojid_keytab_check changed_when: "1 != 1" - name: Verify keytab assert: that: - - "kojid_keytab.stat.exists" + - "kojid_keytab_check.stat.exists" success_msg: "It is likely we have all keytabs" fail_msg: "There are no keytabs. Please build the keytabs." @@ -77,6 +77,9 @@ state: present post_tasks: + - name: "Setup shared filesystem mount" + import_tasks: tasks/koji_efs.yml + - name: Touching run file that ansible has ran here file: path: /var/log/ansible.run diff --git a/ansible/playbooks/tasks/koji_efs.yml b/ansible/playbooks/tasks/koji_efs.yml new file mode 100644 index 0000000..007d44a --- /dev/null +++ b/ansible/playbooks/tasks/koji_efs.yml @@ -0,0 +1,21 @@ +--- +# Sets up the EFS mount for /mnt/koji {{ koji_efs_mount_path }} +# Requires amazon-efs-utils; included +# +- name: Installing amazon-efs-utils + yum: + name: amazon-efs-utils + state: present + tags: + - amazon_efs_utils + - packages + +- name: "Creating and mounting {{ koji_efs_fsid }} at {{ koji_efs_mount_path }}" + ansible.posix.mount: + path: "{{ koji_efs_mount_path }}" + src: "{{ koji_efs_fsid }}:/" + fstype: "{{ koji_efs_fs_type }}" + opts: "{{ koji_efs_fs_opts | join(',') }}" + state: "{{ koji_efs_fs_state | default('mounted') }}" + tags: + - mounts