Skip to content

Instantly share code, notes, and snippets.

@5car1z
Last active October 1, 2017 18:56
Show Gist options
  • Save 5car1z/70265913246c24d29f299e78abd08a87 to your computer and use it in GitHub Desktop.
Save 5car1z/70265913246c24d29f299e78abd08a87 to your computer and use it in GitHub Desktop.
Debian/Ubuntu Apt package update and upgrade playbook, local example.
---
- name: run the playbook tasks on the localhost
hosts: localhost
become: yes
tasks:
- name: print out the hostname of target
command: hostname
- name: ensure aptitude is installed
command: apt-get -y install aptitude
- name: update the apt package index i.e. apt-get update
apt: update_cache=yes
- name: upgrade system packages i.e. apt-get upgrade
apt: upgrade=yes
@5car1z
Copy link
Author

5car1z commented Oct 1, 2017

Needs to be accompanied by this ansible.cfg file and custom hosts file, in the same directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment