Skip to content

Commit

Permalink
Fix bug with metadata conversion and auto-conversion (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkjpryor authored Dec 9, 2024
1 parent faa1c61 commit 0645503
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ansible/roles/linux-user/files/user-create-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0645503

Please sign in to comment.