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 Mar 13, 2024
1 parent 4821fca commit 9316218
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 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
10 changes: 5 additions & 5 deletions utils/ansible/opensuse-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -170,8 +170,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 @@ -181,7 +181,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
10 changes: 5 additions & 5 deletions utils/ansible/rockylinux-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -161,13 +161,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 9316218

Please sign in to comment.