diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml index 336259179..5927a1b0d 100644 --- a/roles/common/defaults/main.yml +++ b/roles/common/defaults/main.yml @@ -170,6 +170,7 @@ tuned_profile: 'virtual-host' # This is the name of the user the `provision` role will create on the # remote host. non_root_user: stack +non_root_group: "{{ non_root_user }}" # Path for volume storage libvirt_volume_path: "{{ working_dir }}/pool" diff --git a/roles/provision/user/tasks/main.yml b/roles/provision/user/tasks/main.yml index 60c8222f7..121747a10 100644 --- a/roles/provision/user/tasks/main.yml +++ b/roles/provision/user/tasks/main.yml @@ -1,16 +1,14 @@ # Create a non-root user on the target host. This is the user that # will own the virtual infrastructure on which we deploy openstack. +- name: Create non-root group + group: + name: "{{ non_root_group }}" + state: present + - name: Create non-root user user: name: "{{ non_root_user }}" + group: "{{ non_root_group }}" state: present shell: /bin/bash become: true - -- name: Get current user group for virthost - command: "id -gn {{ non_root_user }}" - register: virthost_user_group - changed_when: false - -- name: Register fact for current user group - set_fact: non_root_group="{{ virthost_user_group.stdout }}"