Skip to content

Commit

Permalink
Override less Ansible settings (techno-tim#224)
Browse files Browse the repository at this point in the history
* Do not escalate privileges by default

* Do not disable host key checking by default

* Do not mute deprecation warnings by default

* Provide ansible.cfg only as an example

The new example file does ONLY contain options that are related to this
playbook.

* Remove explicit inventory path from scripts

The inventory file is specified in ansible.cfg, see README.md.
  • Loading branch information
sleiner authored Feb 6, 2023
1 parent 96c49c8 commit 49d6d48
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 26 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ node

If multiple hosts are in the master group, the playbook will automatically set up k3s in [HA mode with etcd](https://rancher.com/docs/k3s/latest/en/installation/ha-embedded/).

Finally, copy `ansible.example.cfg` to `ansible.cfg` and adapt the inventory path to match the files that you just created.

This requires at least k3s version `1.19.1` however the version is configurable by using the `k3s_version` variable.

If needed, you can also edit `inventory/my-cluster/group_vars/all.yml` to match your environment.
Expand Down
23 changes: 0 additions & 23 deletions ansible.cfg

This file was deleted.

2 changes: 2 additions & 0 deletions ansible.example.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[defaults]
inventory = inventory/my-cluster/hosts.ini ; Adapt this to the path to your inventory file
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

ansible-playbook site.yml -i inventory/my-cluster/hosts.ini
ansible-playbook site.yml
2 changes: 1 addition & 1 deletion reboot.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

ansible-playbook reboot.yml -i inventory/my-cluster/hosts.ini
ansible-playbook reboot.yml
2 changes: 1 addition & 1 deletion reset.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

ansible-playbook reset.yml -i inventory/my-cluster/hosts.ini
ansible-playbook reset.yml

0 comments on commit 49d6d48

Please sign in to comment.