Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: update README to refer to inventory example. #116

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.

Loading