Skip to content

Commit

Permalink
Merge pull request #5895 from osalyk/fix_ansible
Browse files Browse the repository at this point in the history
common: improve ansible scripts
  • Loading branch information
janekmi authored Nov 2, 2023
2 parents 0216e2c + 2a8bd2b commit c3f72fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 11 additions & 3 deletions utils/ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ sudo zypper install ansible
# or
sudo apt install ansible-core
```

Additionally, install the ansible.posix module to be able to run
the configure-pmem.yml and rockylinux-setup.yml scripts
```sh
sudo ansible-galaxy collection install ansible.posix
```

# Provisioning basics
## Provisioning the target platform
Use the command below to setup the PMDK software development environment:
Expand Down Expand Up @@ -84,7 +91,7 @@ export ROOT_PASSWORD= # a password of root on the target
export GHA_TOKEN= # GitHub token generated for a new self-hosted runner
export HOST_NAME= # host's name that will be visible on GitHub
export LABELS= # rhel or opensuse
export VARS_GHA= # e.g. proxy settings: http_proxy=http://proxy-dmz.XXX.com:911,https_proxy=http://proxy-dmz.XXX.com:912
export VARS_GHA= # e.g. proxy settings: http_proxy=http://proxy-dmz.{XXX}.com:911,https_proxy=http://proxy-dmz.{XXX}.com:912
ansible-playbook -i $TARGET_IP, configure-self-hosted-runner.yml --extra-vars
"host=all ansible_user=root ansible_password=$ROOT_PASSWORD testUser=pmdkuser \
runner_name=$HOST_NAME labels=$LABELS token=$GHA_TOKEN vars_gha=$VARS_GHA"
Expand Down Expand Up @@ -135,6 +142,7 @@ GHA runner without a control node.
# as root:
dnf install git-core -y
dnf install ansible-core -y
ansible-galaxy collection install ansible.posix
git clone https://github.com/pmem/pmdk.git
cd pmdk/utils/ansible
```
Expand All @@ -158,7 +166,7 @@ ansible-playbook configure-pmem.yml --extra-vars "testUser=pmdkuser"
export GHA_TOKEN= # GitHub token generated for a new self-hosted runner
export HOST_NAME=`hostname`
export LABELS= rhel
export VARS_GHA=http_proxy=http://proxy-dmz.XXX.com:911,https_proxy=http://proxy-dmz.XXX.com:912
export VARS_GHA=http_proxy=http://proxy-dmz.{XXX}.com:911,https_proxy=http://proxy-dmz.{XXX}.com:912
ansible-playbook configure-self-hosted-runner.yml -extra-vars \
"testUser=pmdkuser runner_name=$HOST_NAME labels=$LABELS token=$GHA_TOKEN vars_gha=$VARS_GHA"
cd
Expand Down Expand Up @@ -193,7 +201,7 @@ ansible-playbook ./configure-pmem.yml --extra-vars "testUser=pmdkuser"
export GHA_TOKEN= # GitHub token generated for a new self-hosted runner
export HOST_NAME=`hostname`
export LABELS= opensuse
export VARS_GHA=http_proxy=http://proxy-dmz.XXX.com:911,https_proxy=http://proxy-dmz.XXX.com:912
export VARS_GHA=http_proxy=http://proxy-dmz.{XXX}.com:911,https_proxy=http://proxy-dmz.{XXX}.com:912
ansible-playbook configure-self-hosted-runner.yml -extra-vars \
"testUser=pmdkuser runner_name=$HOST_NAME labels=$LABELS token=$GHA_TOKEN vars_gha=$VARS_GHA"
cd
Expand Down
6 changes: 3 additions & 3 deletions utils/ansible/configure-self-hosted-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# export GHA_TOKEN= # a GitHub token generated for a new self-hosted runner
# export HOST_NAME= # host's name that will be visible on GitHub
# export LABELS= # rhel or opensuse
# export VARS_GHA= # e.g. proxy settings: http_proxy=http://proxy-dmz.XXX.com:911,https_proxy=http://proxy-dmz.XXX.com:912
# export VARS_GHA=http_proxy=http://proxy-dmz.{XXX}.com:911,https_proxy=http://proxy-dmz.{XXX}.com:912
# ansible-playbook -i $TARGET_IP, configure-self-hosted-runner.yml --extra-vars \
# "host=all ansible_user=root ansible_password=$ROOT_PASSWORD testUser=pmdkuser \
# runner_name=$HOST_NAME labels=$LABELS token=$GHA_TOKEN vars_gha=$VARS_GHA"
Expand All @@ -24,9 +24,9 @@
# export GHA_TOKEN= # a GitHub token generated for a new self-hosted runner
# export HOST_NAME= # Host name that will be visible on GitHub (e.g. `hostname`)
# export LABELS= # rhel or opensuse
# export VARS_GHA=http_proxy=http://proxy-dmz.XXX.com:911,https_proxy=http://proxy-dmz.XXX.com:912
# export VARS_GHA=http_proxy=http://proxy-dmz.{XXX}.com:911,https_proxy=http://proxy-dmz.{XXX}.com:912
# ansible-playbook configure-self-hosted-runner.yml --extra-vars \
# "runner_name=$HOST_NAME labels=$LABELS vars_gha=env1,env2 token=$GHA_TOKEN"
# "runner_name=$HOST_NAME labels=$LABELS vars_gha=$VARS_GHA token=$GHA_TOKEN"
#

#
Expand Down
3 changes: 2 additions & 1 deletion utils/ansible/opensuse-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

# This playbook is designed to install all required packages and configure
# OpenSUSE to execute tests.
# The playbook description and how to use it are available in the README.md file.
# The playbook description and how to use it are available
# in the README.md file.

- hosts: "{{ host }}"
# - hosts: localhost
Expand Down

0 comments on commit c3f72fb

Please sign in to comment.