Skip to content

Commit

Permalink
ansible: update README to refer to inventory example.
Browse files Browse the repository at this point in the history
Signed-off-by: Manu Bretelle <[email protected]>
  • Loading branch information
chantra committed Dec 7, 2023
1 parent ab54974 commit aec887f
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,31 @@
sudo dnf install -y ansible
```

## SSH keys
`ansible` uses SSH to connect to hosts. We can put the s390x machines key in our ssh authentication agent to automatically authenticate without having to keep a copy of the key on our dev server:

```
ssh-add <(secrets_tool get_from_group KERNEL_PATCHES_S390X_SSH_PRIVATE_KEY KERNEL_PATCHES_KEYS)
```

## Inventory

The [inventory](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html) is where we define our hosts, hostgroup, possibly variable...

Using an inventory similar to P531683832.
Using an inventory similar to [inventory_example.yml](inventory_example.yml).

After having changed the github token, one can run the following commands:

Run the playbook against `bpf-ci-runner-s390x` only, and in check mode (`-C`):
Run the playbook against `s390x` only, and in check mode (`-C`):
```
ansible-playbook -i ~/inventory.yml ansible/playbook.yml -C --limit bpf-ci-runner-s390x
ansible-playbook -i ~/inventory.yml ansible/playbook.yml -C --limit s390x
```

Run the playbook against all hosts in `s390x_odd` group, in check mode and display the change diff `-D`:
Run the playbook against all hosts in `repo_and_org_runner` group, in check mode and display the change diff `-D`:

```
ansible-playbook -i ~/inventory.yml ansible/playbook.yml -C -D --limit s390x_odd
ansible-playbook -i ~/inventory.yml ansible/playbook.yml -C -D --limit repo_and_org_runner
```
See output in P531732743 .


Same, but against all hosts:
```
ansible-playbook -i ~/inventory.yml ansible/playbook.yml -C -D
```

To actually apply the changes, remove `-C`.

0 comments on commit aec887f

Please sign in to comment.