From 9316218d2937a351e618e0268c263d47d83fcd6a Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Wed, 13 Mar 2024 11:45:53 +0100 Subject: [PATCH] common: rename testUser to new_user Signed-off-by: Tomasz Gromadzki --- utils/ansible/README.md | 12 ++++++------ utils/ansible/opensuse-setup.yml | 10 +++++----- utils/ansible/rockylinux-setup.yml | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/utils/ansible/README.md b/utils/ansible/README.md index 189e338d72d..fcf36aa1281 100644 --- a/utils/ansible/README.md +++ b/utils/ansible/README.md @@ -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. @@ -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. @@ -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 @@ -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 diff --git a/utils/ansible/opensuse-setup.yml b/utils/ansible/opensuse-setup.yml index 74e0d499191..2e0cb7efe7f 100644 --- a/utils/ansible/opensuse-setup.yml +++ b/utils/ansible/opensuse-setup.yml @@ -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 @@ -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 @@ -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: diff --git a/utils/ansible/rockylinux-setup.yml b/utils/ansible/rockylinux-setup.yml index 501f1ac6b94..1844aa65e04 100644 --- a/utils/ansible/rockylinux-setup.yml +++ b/utils/ansible/rockylinux-setup.yml @@ -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 @@ -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: