From a01d6b3316cab17b1eabfef51f43474207767861 Mon Sep 17 00:00:00 2001 From: Pierre Guillod Date: Mon, 10 Apr 2023 12:14:31 +0200 Subject: [PATCH] add update playbook + document --- README.md | 19 ++++++++++++++++++- update.yml | 7 +++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 update.yml diff --git a/README.md b/README.md index b47f8ab..5413d13 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # ansible-playbooks -Ansible playbooks to manage the IT infrastructure \ No newline at end of file +Ansible playbooks to manage the IT infrastructure. + +## Configure hosts + +Make sure to define the hosts in `/etc/ansible/hosts`: + +```sh +[serversgroup] + ansible_user=ansible +``` + +## Run playbooks + +The `ssh` credentials can be specified interactively: + +```sh +ansible-playbook .yml -k +``` \ No newline at end of file diff --git a/update.yml b/update.yml new file mode 100644 index 0000000..14bd486 --- /dev/null +++ b/update.yml @@ -0,0 +1,7 @@ +- hosts: dnfservers + tasks: + - name: Upgrade apt packages + become: yes + apt: + upgrade: "dist" + update_cache: yes