Skip to content

Commit

Permalink
common: rename testUser to new_user
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
  • Loading branch information
grom72 committed Oct 2, 2024
1 parent 6aa87f3 commit 2258d3e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions utils/ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export SETUP_SCRIPT= # opensuse-setup.yml or rockylinux-setup.yml

ansible-playbook -i $TARGET_IP, $SETUP_SCRIPT \
--extra-vars "host=all ansible_user=root ansible_password=$ROOT_PASSWORD \
testUser=pmdkuser testUserPass=pmdkpass"
new_user=pmdkuser new_user_pass=pmdkpass"
```
**Note**: If the Linux kernel is outdated, `opensuse-setup.yml` and
`rockylinux-setup.yml` playbooks will reboot the target platform.
Expand Down Expand Up @@ -128,7 +128,7 @@ uncomment the following two:
and run commands as follows e.g.
```sh
export SETUP_SCRIPT= # opensuse-setup.yml or rockylinux-setup.yml
sudo ansible-playbook $SETUP_SCRIPT --extra-vars "ansible_user=pmdkuser"
sudo ansible-playbook $SETUP_SCRIPT --extra-vars "new_user=pmdkuser"
```
**Note**: If a reboot is necessary, as described above, perform it manually and
rerun the playbook without in question.
Expand Down Expand Up @@ -161,12 +161,12 @@ Update playbooks to be used directly on the target as described [above](#provisi
and execute:
```sh
# as root:
ansible-playbook rockylinux-setup.yml --extra-vars "testUser=pmdkuser testUserPass=pmdkpass"
ansible-playbook rockylinux-setup.yml --extra-vars "new_user=pmdkuser new_user_pass=pmdkpass"
# reboot shall be performed only if the playbook requests to do it.
reboot
# ...
cd pmdk/utils/ansible
ansible-playbook rockylinux-setup.yml --extra-vars "testUser=pmdkuser testUserPass=pmdkpass"
ansible-playbook rockylinux-setup.yml --extra-vars "new_user=pmdkuser new_user_pass=pmdkpass"
```
Log in as `pmdkuser` and execute:
```sh
Expand Down Expand Up @@ -201,12 +201,12 @@ Update playbooks to be used directly on the target as described [above](#provisi
and execute:
```sh
# as root:
ansible-playbook opensuse-setup.yml --extra-vars "testUser=pmdkuser testUserPass=pmdkpass"
ansible-playbook opensuse-setup.yml --extra-vars "new_user=pmdkuser new_user_pass=pmdkpass"
# reboot shall be performed only if the playbook requests to do it.
reboot
# ...
cd pmdk/utils/ansible
ansible-playbook opensuse-setup.yml --extra-vars "testUser=pmdkuser testUserPass=pmdkpass"
ansible-playbook opensuse-setup.yml --extra-vars "new_user=pmdkuser new_user_pass=pmdkpass"
```
Log in as `pmdkuser` and execute:
```sh
Expand Down
2 changes: 1 addition & 1 deletion utils/ansible/configure-pmem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#
# 2) locally
# For a playbook to be used on a local server please log in as pmdkuser:
# a) comment out the first command: # -hosts: "{{ host }}"
# a) comment out the first command: # - hosts: "{{ host }}"
# b) uncomment the next two lines:
# - hosts: localhost
# connection: local
Expand Down
2 changes: 1 addition & 1 deletion utils/ansible/configure-self-hosted-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# 2) locally
# For a playbook to be used on a local server please log in as pmdkuser:
# a) comment out the first command: # -hosts: "{{ host }}"
# a) comment out the first command: # - hosts: "{{ host }}"
# b) uncomment the next two lines:
# - hosts: localhost
# connection: local
Expand Down
14 changes: 7 additions & 7 deletions utils/ansible/opensuse-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# The playbook description and how to use it are available
# in the README.md file.
#
# Below is an example of how to use this file localy:
# Below is an example of how to use this file locally:
#
# a) comment out the first command:
# -hosts: "{{ host }}"
# - hosts: "{{ host }}"
# b) uncomment the next two lines:
# - hosts: localhost
# connection: local
Expand All @@ -21,8 +21,8 @@
# - hosts: localhost
# connection: local
vars:
testUser: null
testUserPass: pmdkpass
new_user: null
new_user_pass: pmdkpass

tasks:
- name: Update kernel packages
Expand Down Expand Up @@ -173,8 +173,8 @@
- name: Add new user
shell: |
#!/usr/bin/env bash
export USER={{ testUser }}
export USERPASS={{ testUserPass }}
export USER={{ new_user }}
export USERPASS={{ new_user_pass }}
useradd -m $USER
export PFILE=./password
echo $USERPASS > $PFILE
Expand All @@ -184,7 +184,7 @@
sed -i 's/# %wheel/%wheel/g' /etc/sudoers
groupadd wheel
gpasswd wheel -a $USER
when: testUser != None
when: new_user != None

- name: Set variable OS
env:
Expand Down
14 changes: 7 additions & 7 deletions utils/ansible/rockylinux-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# The playbook description and how to use it are available
# in the README.md file.
#
# Below is an example of how to use this file localy:
# Below is an example of how to use this file locally:
#
# a) comment out the first command:
# -hosts: "{{ host }}"
# - hosts: "{{ host }}"
# b) uncomment the next two lines:
# - hosts: localhost
# connection: local
Expand All @@ -21,8 +21,8 @@
# - hosts: localhost
# connection: local
vars:
testUser: null
testUserPass: pmdkpass
new_user: null
new_user_pass: pmdkpass

tasks:
- name: Update kernel packages
Expand Down Expand Up @@ -168,13 +168,13 @@
- name: Add new user
shell: |
#!/usr/bin/env bash
export USER={{ testUser }}
export USERPASS={{ testUserPass }}
export USER={{ new_user }}
export USERPASS={{ new_user_pass }}
useradd -m $USER
echo $USERPASS | passwd $USER --stdin
gpasswd wheel -a $USER
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
when: testUser != none
when: new_user != none

- name: Set variable OS
env:
Expand Down

0 comments on commit 2258d3e

Please sign in to comment.