Skip to content

Commit

Permalink
chore: Add create_system_user var
Browse files Browse the repository at this point in the history
* Users can skip user creation by setting this variable to false

Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Mar 2, 2024
1 parent 7df3191 commit bd3aa4c
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 15 deletions.
1 change: 1 addition & 0 deletions roles/ceems_api_server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ ceems_api_server_env_vars: {}
ceems_api_server_binary_install_dir: /usr/local/bin
ceems_api_server_system_group: ceems
ceems_api_server_system_user: "{{ ceems_api_server_system_group }}"
ceems_api_server_create_system_user_group: true
9 changes: 7 additions & 2 deletions roles/ceems_api_server/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,17 @@ argument_specs:
ceems_api_server_binary_install_dir:
description:
- I(Advanced)
- Directory to install ceems_api_server binary
- Directory to install CEEMS API server binary
default: /usr/local/bin
ceems_api_server_create_system_user_group:
description:
- I(Advanced)
- Create system user and group for CEEMS API server
default: true
ceems_api_server_system_group:
description:
- I(Advanced)
- System group for batch job stats server
- System group for CEEMS API server server
default: ceems
ceems_api_server_system_user:
description:
Expand Down
8 changes: 6 additions & 2 deletions roles/ceems_api_server/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
name: "{{ ceems_api_server_system_group }}"
state: present
system: true
when: ceems_api_server_system_group != "root"
when:
- ceems_api_server_system_group != "root"
- ceems_api_server_create_system_user_group

- name: Create the ceems_api_server user
ansible.builtin.user:
Expand All @@ -15,7 +17,9 @@
system: true
create_home: false
home: /
when: ceems_api_server_system_user != "root"
when:
- ceems_api_server_system_user != "root"
- ceems_api_server_create_system_user_group

- name: Get binary
when:
Expand Down
1 change: 1 addition & 0 deletions roles/ceems_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ ceems_exporter_env_vars: {}
ceems_exporter_binary_install_dir: /usr/local/bin
ceems_exporter_system_group: ceemsexp
ceems_exporter_system_user: "{{ ceems_exporter_system_group }}"
ceems_exporter_create_system_user_group: true
5 changes: 5 additions & 0 deletions roles/ceems_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ argument_specs:
- I(Advanced)
- Directory to install ceems_exporter binary
default: /usr/local/bin
ceems_exporter_create_system_user_group:
description:
- I(Advanced)
- Create system user and group for CEEMS exporter
default: true
ceems_exporter_system_group:
description:
- I(Advanced)
Expand Down
8 changes: 6 additions & 2 deletions roles/ceems_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
name: "{{ ceems_exporter_system_group }}"
state: present
system: true
when: ceems_exporter_system_group != "root"
when:
- ceems_exporter_system_group != "root"
- ceems_exporter_create_system_user_group

- name: Create the ceems_exporter user
ansible.builtin.user:
Expand All @@ -15,7 +17,9 @@
system: true
create_home: false
home: /
when: ceems_exporter_system_user != "root"
when:
- ceems_exporter_system_user != "root"
- ceems_exporter_create_system_user_group

- name: Get binary
when:
Expand Down
1 change: 1 addition & 0 deletions roles/ceems_lb/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ ceems_lb_env_vars: {}
ceems_lb_binary_install_dir: /usr/local/bin
ceems_lb_system_group: ceems
ceems_lb_system_user: "{{ ceems_lb_system_group }}"
ceems_lb_create_system_user_group: true
5 changes: 5 additions & 0 deletions roles/ceems_lb/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ argument_specs:
- I(Advanced)
- Directory to install ceems_lb binary
default: /usr/local/bin
ceems_lb_create_system_user_group:
description:
- I(Advanced)
- Create system user and group for CEEMS load balancer
default: true
ceems_lb_system_group:
description:
- I(Advanced)
Expand Down
8 changes: 6 additions & 2 deletions roles/ceems_lb/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
name: "{{ ceems_lb_system_group }}"
state: present
system: true
when: ceems_lb_system_group != "root"
when:
- ceems_lb_system_group != "root"
- ceems_lb_create_system_user_group

- name: Create the ceems_lb user
ansible.builtin.user:
Expand All @@ -15,7 +17,9 @@
system: true
create_home: false
home: /
when: ceems_lb_system_user != "root"
when:
- ceems_lb_system_user != "root"
- ceems_lb_create_system_user_group

- name: Get binary
when:
Expand Down
1 change: 1 addition & 0 deletions roles/litestream/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ litestream_env_vars: {}
litestream_binary_install_dir: /usr/local/bin
litestream_system_group: root
litestream_system_user: "{{ litestream_system_group }}"
litestream_create_system_user_group: true
5 changes: 5 additions & 0 deletions roles/litestream/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ argument_specs:
- I(Advanced)
- Directory to install litestream binary
default: /usr/local/bin
litestream_create_system_user_group:
description:
- I(Advanced)
- Create system user and group for litestream
default: true
litestream_system_group:
description:
- I(Advanced)
Expand Down
8 changes: 6 additions & 2 deletions roles/litestream/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
name: "{{ litestream_system_group }}"
state: present
system: true
when: litestream_system_group != "root"
when:
- litestream_system_group != "root"
- litestream_create_system_user_group

- name: Create the litestream user
ansible.builtin.user:
Expand All @@ -15,7 +17,9 @@
system: true
create_home: false
home: /
when: litestream_system_user != "root"
when:
- litestream_system_user != "root"
- litestream_create_system_user_group

- name: Get binary
when:
Expand Down
1 change: 1 addition & 0 deletions roles/nvidia_dcgm_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ nvidia_dcgm_exporter_cli_args: []
nvidia_dcgm_exporter_binary_install_dir: /usr/local/bin
nvidia_dcgm_exporter_system_group: dcgmexp
nvidia_dcgm_exporter_system_user: "{{ nvidia_dcgm_exporter_system_group }}"
nvidia_dcgm_exporter_create_system_user_group: true
11 changes: 8 additions & 3 deletions roles/nvidia_dcgm_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,24 @@ argument_specs:
- I(Advanced)
- Directory to install nvidia_dcgm_exporter binary
default: /usr/local/bin
nvidia_dcgm_exporter_create_system_user_group:
description:
- I(Advanced)
- Create system user and group for nVIDIA DCGM exporter
default: true
nvidia_dcgm_exporter_system_group:
description:
- I(Advanced)
- System group for batch job exporter
- System group for nVIDIA DCGM exporter
default: dcgm-exp
nvidia_dcgm_exporter_system_user:
description:
- I(Advanced)
- DCGM exporter user
- nVIDIA DCGM exporter user
default: dcgm-exp
nvidia_dcgm_exporter_cli_args:
description:
- I(Advanced)
- Additional CLI arguments that will be passed to DCGM exporter
- Additional CLI arguments that will be passed to nVIDIA DCGM exporter
type: list
elements: str
8 changes: 6 additions & 2 deletions roles/nvidia_dcgm_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
name: "{{ nvidia_dcgm_exporter_system_group }}"
state: present
system: true
when: nvidia_dcgm_exporter_system_group != "root"
when:
- nvidia_dcgm_exporter_system_group != "root"
- nvidia_dcgm_exporter_create_system_user_group

- name: Create the nvidia_dcgm_exporter user
ansible.builtin.user:
Expand All @@ -15,7 +17,9 @@
system: true
create_home: false
home: /
when: nvidia_dcgm_exporter_system_user != "root"
when:
- nvidia_dcgm_exporter_system_user != "root"
- nvidia_dcgm_exporter_create_system_user_group

- name: Get binary
when:
Expand Down

0 comments on commit bd3aa4c

Please sign in to comment.