Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marktheunissen/2979474 to your computer and use it in GitHub Desktop.
Save marktheunissen/2979474 to your computer and use it in GitHub Desktop.
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@jtyr
Copy link

jtyr commented Nov 30, 2014

This Gist is very useful and I wish the author keeps it up-to-date. If somebody already tried to update it, please place your Gist link here.

@chacham15
Copy link

@mpdehaan while this may be out of date it is still way more informative for the beginner than any of the official examples or docs. Take one of the examples in your example directory: https://github.com/ansible/ansible-examples/blob/master/wordpress-nginx/roles/nginx/tasks/main.yml what does this tell someone like me who just picked up ansible?

@nfarrar
Copy link

nfarrar commented Jan 30, 2015

Wicked useful, thank you!

@FractalizeR
Copy link

An insanely great job ;)

@yonassrobi
Copy link

Nice collection!

@thomo
Copy link

thomo commented Sep 20, 2015

I just started to learn ansible but would suggest the following modifications:

  • line 83:
    • org

      user: remoteuser
      
    • new

      remote_user: remoteuser
      ### The remote_user parameter was formerly called just user. It was renamed in Ansible 1.4 to make it more distinguishable from the user module (used to create users on remote systems).
      
  • line 107:
    • org

       # For this example, ${web.memcache} and ${web.apache} are both usable
      
    • new

      # For this example, ${web.memcache} and ${web.httpd} are both usable
      

@sudhevan
Copy link

hi,
is there a way to specify the become user is handlers part?

handlers:

  • name: restart apache
    service: name=apache state=restarted
    become=yes

Copy link

ghost commented Mar 14, 2016

I know this is out of date... but I'm going to say it anyways as an FYI-- in Line 433 you can no longer include handlers as of Ansible 2.0

@derek-adair
Copy link

This would be really cool to evolve and keep up to date to showcase a detailed changelog.

@shiplu
Copy link

shiplu commented Apr 12, 2016

Great Playbook. A lot of things are clear to me now.

@gretel
Copy link

gretel commented May 4, 2016

should be part of the core documentation. thanks!

@SayBeano
Copy link

SayBeano commented May 23, 2016

Amazing!

edit: And thanks, @marktheunissen!

@henryxn
Copy link

henryxn commented May 26, 2016

In term of using variable in hosts attribute (line 58)
ORIG:

hosts: $groups -- apply to all hosts specified in the variable $groups

REVISE:
hosts : group # No $

$ ansible-playbook playbook1.yml -e "group=myservers"
or
$ ansible-playbook playbook1.yml --extra-vars="target=myservers"

@akofink
Copy link

akofink commented Jul 26, 2016

sudo: true is deprecated in favor of become: true

source: http://docs.ansible.com/ansible/become.html

@antoniopinarella
Copy link

which editor u use for yaml?

@claudiols1979
Copy link

@antoniopinarella you can use any text editor. I use vim for .yml and it works fine.
(Probably you found it out. However for new people searches. )

@flamein
Copy link

flamein commented Mar 9, 2018

Can we please bury this Gist? it keeps showing up as clickbait in search engines while the syntax is horribly outdated.

@dataf3l
Copy link

dataf3l commented Sep 25, 2019

I love this, please include "become"

@ogratwicklcs
Copy link

I have made a fork and updated some of the content that has been deprecated.
https://gist.github.com/ogratwicklcs/b9765a5b053b46586b4eb7fe61a15c82

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