diff --git a/ansible/roles/linux-user/files/user-create-playbook.yml b/ansible/roles/linux-user/files/user-create-playbook.yml index 4b1a701..66bd87b 100644 --- a/ansible/roles/linux-user/files/user-create-playbook.yml +++ b/ansible/roles/linux-user/files/user-create-playbook.yml @@ -12,7 +12,7 @@ ansible.builtin.set_fact: azimuth_uid: "{{ openstack_metadata['azimuth_uid'] | default('1005') }}" azimuth_gid: "{{ openstack_metadata['azimuth_gid'] | default('1005') }}" - azimuth_is_sudo: "{{ openstack_metadata['azimuth_is_sudo'] | default('yes') }}" + azimuth_is_sudo: "{{ (openstack_metadata['azimuth_is_sudo'] | default('yes')) == 'yes' }}" azimuth_ssh_keys: "{{ openstack_userdata.azimuth_users[0].ssh_authorized_keys | default([]) }}" - name: Setup Azimuth home directory @@ -62,18 +62,18 @@ key: "{{ item }}" with_items: "{{ azimuth_ssh_keys }}" - - name: Add the Azimuth user to sudoers - ansible.builtin.user: - name: "azimuth" - groups: sudo - when: azimuth_is_sudo == "yes" + - block: + - name: Add the Azimuth user to sudoers + ansible.builtin.user: + name: "azimuth" + groups: sudo - - name: Make sudo without password for users - ansible.builtin.copy: - dest: /etc/sudoers.d/80-ansible-sudo-user - content: "azimuth ALL=(ALL) NOPASSWD:ALL" - mode: 0440 - when: azimuth_is_sudo == "yes" + - name: Make sudo without password for users + ansible.builtin.copy: + dest: /etc/sudoers.d/80-ansible-sudo-user + content: "azimuth ALL=(ALL) NOPASSWD:ALL" + mode: 0440 + when: azimuth_is_sudo - name: Setup MOTD for user ansible.builtin.blockinfile: