openqa/server: make geekotest static UID/GID optional
I'm still kinda trying to make the openqa roles usable outside of infra, so now I have a minute, let's do this: it makes the static UID/GID for geekotest optional and configurable, instead of hard coding it. For infra we set the value to 601, as we are already using, in the openqa and openqa-stg group config.
This commit is contained in:
parent
37d3559893
commit
f4133798f6
3 changed files with 13 additions and 8 deletions
|
@ -3,6 +3,8 @@ virt_install_command: "{{ virt_install_command_one_nic }} --cpu=host-passthrough
|
||||||
|
|
||||||
external_hostname: openqa.fedoraproject.org
|
external_hostname: openqa.fedoraproject.org
|
||||||
|
|
||||||
|
openqa_static_uid = 601
|
||||||
|
|
||||||
openqa_hostname: localhost
|
openqa_hostname: localhost
|
||||||
openqa_email: adamwill@fedoraproject.org
|
openqa_email: adamwill@fedoraproject.org
|
||||||
openqa_nickname: adamwill
|
openqa_nickname: adamwill
|
||||||
|
|
|
@ -14,6 +14,8 @@ virt_install_command: "{{ virt_install_command_one_nic }} --cpu=host-passthrough
|
||||||
|
|
||||||
external_hostname: openqa.stg.fedoraproject.org
|
external_hostname: openqa.stg.fedoraproject.org
|
||||||
|
|
||||||
|
openqa_static_uid = 601
|
||||||
|
|
||||||
openqa_hostname: localhost
|
openqa_hostname: localhost
|
||||||
openqa_email: adamwill@fedoraproject.org
|
openqa_email: adamwill@fedoraproject.org
|
||||||
openqa_nickname: adamwill
|
openqa_nickname: adamwill
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
## default - ansible_nodename
|
## default - ansible_nodename
|
||||||
|
|
||||||
# Optional vars
|
# Optional vars
|
||||||
|
# - openqa_static_uid
|
||||||
|
## int - a static ID for the geekotest user and group if desired
|
||||||
|
## this is useful for NFS mounting openQA data files
|
||||||
# - openqa_dbname
|
# - openqa_dbname
|
||||||
## string - The name of the database to use
|
## string - The name of the database to use
|
||||||
# - openqa_dbhost
|
# - openqa_dbhost
|
||||||
|
@ -35,23 +38,21 @@
|
||||||
# set, the server will use a local SQLite database and the other values
|
# set, the server will use a local SQLite database and the other values
|
||||||
# are ignored.
|
# are ignored.
|
||||||
|
|
||||||
# As we want to store some geekotest-owned files in shared storage, we
|
- name: Create geekotest group with static GID
|
||||||
# need to ensure geekotest always has the same uid/gid if we re-deploy
|
group: "name=geekotest gid={{ openqa_static_uid }} system=yes"
|
||||||
# the servers. So we create the account here with uid/gid 601.
|
when: "openqa_static_uid is defined"
|
||||||
|
|
||||||
- name: Create geekotest group with static GID 601
|
- name: Create geekotest user with static UID
|
||||||
group: name=geekotest gid=601 system=yes
|
|
||||||
|
|
||||||
- name: Create geekotest user with static UID 601
|
|
||||||
user:
|
user:
|
||||||
name: geekotest
|
name: geekotest
|
||||||
comment: "openQA user"
|
comment: "openQA user"
|
||||||
uid: 601
|
uid: "{{ openqa_static_uid }}"
|
||||||
group: geekotest
|
group: geekotest
|
||||||
home: "/var/lib/openqa"
|
home: "/var/lib/openqa"
|
||||||
createhome: no
|
createhome: no
|
||||||
system: yes
|
system: yes
|
||||||
shell: /sbin/nologin
|
shell: /sbin/nologin
|
||||||
|
when: "openqa_static_uid is defined"
|
||||||
|
|
||||||
# note: we need updates-testing until fedfind 2.x and openQA 4.3-21 go stable
|
# note: we need updates-testing until fedfind 2.x and openQA 4.3-21 go stable
|
||||||
- name: Install required packages (testing)
|
- name: Install required packages (testing)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue