Make sudoers config optional in bootstrap-servers

In some environments it may not be desirable to modify the sudoers
configuration. This change makes this part of bootstrap-servers
optional, based on the create_kolla_user_sudoers variable.

Change-Id: I653403bfc5431741807edef57df58e05e679900b
This commit is contained in:
Mark Goddard 2018-07-09 19:07:22 +01:00
parent 2a69050e37
commit 8ec92df8e3
3 changed files with 10 additions and 2 deletions

View File

@ -9,6 +9,7 @@ docker_gpg_fingerprint: "58118E89F3A912897C070ADBF76221572C52609D"
customize_etc_hosts: True customize_etc_hosts: True
create_kolla_user: True create_kolla_user: True
create_kolla_user_sudoers: "{{ create_kolla_user }}"
kolla_user: "kolla" kolla_user: "kolla"
kolla_group: "kolla" kolla_group: "kolla"

View File

@ -21,7 +21,7 @@
path: /etc/sudoers.d/kolla-ansible-users path: /etc/sudoers.d/kolla-ansible-users
state: touch state: touch
become: True become: True
when: create_kolla_user | bool when: create_kolla_user_sudoers | bool
- name: Grant kolla user passwordless sudo - name: Grant kolla user passwordless sudo
lineinfile: lineinfile:
@ -30,7 +30,7 @@
regexp: '^{{ kolla_group }}' regexp: '^{{ kolla_group }}'
line: '{{ kolla_group }} ALL=(ALL) NOPASSWD: ALL' line: '{{ kolla_group }} ALL=(ALL) NOPASSWD: ALL'
become: True become: True
when: create_kolla_user | bool when: create_kolla_user_sudoers | bool
- name: Ensure virtualenv has correct ownership - name: Ensure virtualenv has correct ownership
file: file:

View File

@ -0,0 +1,7 @@
---
features:
- |
Adds support for skipping the configuration of sudoers files in the
``kolla-ansible bootstrap-servers`` command. This depends on the
``create_kolla_user_sudoers`` variable, which defaults to the same value as
``create_kolla_user``.