From 24c311aab02b8e50b817bff4e008a0d8b32443ca Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Wed, 17 Feb 2021 14:36:11 +0100 Subject: [PATCH] Add cloud-admin user to tripleoclient container osp-director-operator use tripleoclient pod to render the ansible playbooks in an ephemeral heat stack. The cloud-admin user is also used as default deployment user to run the ansible playbooks to deploy the overcloud. This also adds osc-placement to the container image which allows to query placment direct using osc. Change-Id: I38fe6419a6e18693adad79083a589f3a417de02f --- container-images/kolla/base/uid_gid_manage.sh | 1 + container-images/kolla/tripleoclient/tripleoclient_sudoers | 1 + .../tcib/base/tripleoclient/tripleoclient.yaml | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 container-images/kolla/tripleoclient/tripleoclient_sudoers diff --git a/container-images/kolla/base/uid_gid_manage.sh b/container-images/kolla/base/uid_gid_manage.sh index faae04750..a9733055a 100755 --- a/container-images/kolla/base/uid_gid_manage.sh +++ b/container-images/kolla/base/uid_gid_manage.sh @@ -37,6 +37,7 @@ _SUPPORTED_USERS['aodh']='aodh 42402 42402 /var/lib/aodh kolla' _SUPPORTED_USERS['barbican']='barbican 42403 42403 /var/lib/barbican kolla,nfast' _SUPPORTED_USERS['ceilometer']='ceilometer 42405 42405 /var/lib/ceilometer kolla' _SUPPORTED_USERS['cinder']='cinder 42407 42407 /var/lib/cinder kolla' +_SUPPORTED_USERS['cloud-admin']='cloud-admin 42401 42401 /home/cloud-admin' _SUPPORTED_USERS['collectd']='collectd 42409 42409 /var/lib/collectd kolla' _SUPPORTED_USERS['designate']='designate 42411 42411 /var/lib/designate kolla' _SUPPORTED_USERS['etcd']='etcd 42413 42413 /var/lib/etcd kolla' diff --git a/container-images/kolla/tripleoclient/tripleoclient_sudoers b/container-images/kolla/tripleoclient/tripleoclient_sudoers new file mode 100644 index 000000000..b584ef961 --- /dev/null +++ b/container-images/kolla/tripleoclient/tripleoclient_sudoers @@ -0,0 +1 @@ +cloud-admin ALL=(ALL) NOPASSWD: ALL diff --git a/container-images/tcib/base/tripleoclient/tripleoclient.yaml b/container-images/tcib/base/tripleoclient/tripleoclient.yaml index bce6eeed5..aec46fdc6 100644 --- a/container-images/tcib/base/tripleoclient/tripleoclient.yaml +++ b/container-images/tcib/base/tripleoclient/tripleoclient.yaml @@ -1,7 +1,11 @@ tcib_actions: +- run: bash /usr/local/bin/uid_gid_manage {{ tcib_user }} - run: dnf -y install {{ tcib_packages['common'] | join(' ') }} && dnf clean all && rm -rf /var/cache/dnf +- run: openstack complete | tee /etc/bash_completion.d/osc.bash_completion > /dev/null - copy: /usr/share/tripleo-common/container-images/kolla/tripleoclient/create_super_user.sh /usr/local/bin/create_super_user.sh +- copy: /usr/share/tripleo-common/container-images/kolla/tripleoclient/tripleoclient_sudoers /etc/sudoers.d/tripleoclient_sudoers - run: chmod 750 /usr/local/bin/create_super_user.sh +- run: chmod 440 /etc/sudoers.d/tripleoclient_sudoers tcib_gather_files: '{{ lookup(''fileglob'', ''/usr/share/tripleo-common/container-images/kolla/tripleoclient/*'', wantlist=True) }}' tcib_packages: common: @@ -14,3 +18,6 @@ tcib_packages: - python3-openstackclient - python3-tripleoclient - xfsprogs + - python3-osc-placement + - bash-completion +tcib_user: cloud-admin