add update playbook + document
This commit is contained in:
parent
25fa541690
commit
a01d6b3316
2 changed files with 25 additions and 1 deletions
19
README.md
19
README.md
|
@ -1,3 +1,20 @@
|
||||||
# ansible-playbooks
|
# ansible-playbooks
|
||||||
|
|
||||||
Ansible playbooks to manage the IT infrastructure
|
Ansible playbooks to manage the IT infrastructure.
|
||||||
|
|
||||||
|
## Configure hosts
|
||||||
|
|
||||||
|
Make sure to define the hosts in `/etc/ansible/hosts`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[serversgroup]
|
||||||
|
<hostname or IP address> ansible_user=ansible
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run playbooks
|
||||||
|
|
||||||
|
The `ssh` credentials can be specified interactively:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible-playbook <playbook>.yml -k
|
||||||
|
```
|
7
update.yml
Normal file
7
update.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
- hosts: dnfservers
|
||||||
|
tasks:
|
||||||
|
- name: Upgrade apt packages
|
||||||
|
become: yes
|
||||||
|
apt:
|
||||||
|
upgrade: "dist"
|
||||||
|
update_cache: yes
|
Loading…
Reference in a new issue