Ansible Playbook

Only for my Ubuntu (for now).

Install

$ sudo apt install ansible

Using

$ ansible-playbook -e user="foo" group="bar" local.yaml -K
  • -K (--ask-become-pass) To specify a password for sudo.

Helper (sudo)

$ ./run-sudo-ansible-playbook.sh

Test with Docker

Init Docker

$ docker run --rm -v $PWD:/ansible -it ubuntu bash

Inside

# cd /ansible
# ./run-sudo-ansible-playbook.sh

or only "web"

# ./run-sudo-ansible-playbook.sh --tags "web"

or "ubuntu" and "docker" (and using verbose)

# ./run-sudo-ansible-playbook.sh --tags "ubuntu,docker" -vv

Verbose options:

  • -v
  • -vv
  • -vvv
  • -vvvv

List all Tasks

$ ansible-playbook local.yaml --list-tasks