/pedantically_commented_playbook.yml
Forked from phred/pedantically_commented_playbook.ymlThis playbook has been removed as it is now very outdated. |
This comment has been minimized.
This comment has been minimized.
Just note that the per-action user doesn't work. Ansible complains that multiple actions are defined for that item.. |
This comment has been minimized.
This comment has been minimized.
@vmalloc Yes, welcome to conflicting namespaces ! Ever since we allowed to ommit 'action:' and directly do 'module:' we risk having more than one action, or worse conflicting keywords. |
This comment has been minimized.
This comment has been minimized.
LOVE This. Thank you so much. |
This comment has been minimized.
This comment has been minimized.
I just wanted to mention to everyone that this, while great at the time, is now pretty old. It doesn't show roles and a lot of features in 1.2, and still uses the "only_if" syntax, which is now made easier by "when". In addition, variable substitution is also in many ways improved. While things remain compatible, these are not the best ways to do everything in all cases. (Many things remain unchanged, of course), nor does it show everything. I would suggest reading the latest documentation at http://ansible.cc/docs and then also looking at the "ansible-examples repo: https://github.com/ansible/ansible-examples Which shows various things put into context. |
This comment has been minimized.
This comment has been minimized.
mpdehaan is right. For example, the example above (line 50 and following) states ',' as separator when using multiple groups in a hosts declaration, while http://ansible.cc/docs/patterns.html#selecting-targets shows ':' . The latter is correct, took me some time to figure it out. But still my respect for this of course! It's helped me a lot getting to know all of ansible's possibilities! |
This comment has been minimized.
This comment has been minimized.
Other misguiding info in this example:
So, only one playbook is allowed per YAML file, actually, such YAML file is a playbook. But playbook consists of one or more of "plays", and "hosts:" line marks beginning of a play, there can be multiple, each applying to a different (or even to same!) set of hosts. |
This comment has been minimized.
This comment has been minimized.
Shouldn't this say ${web.httpd} instead of ${web.apache} ?
|
This comment has been minimized.
This comment has been minimized.
At this point in time ${foo} variables are deprecated and slated for removal in 1.6. Operators with "when_foo" are also completely removed as of 1.5 in favor of the simplified when, and there is no "only_if" operation. While I'm very happy this was created, folks should refer to docs.ansible.com instead at this time. |
This comment has been minimized.
This comment has been minimized.
this is awesome! |
This comment has been minimized.
This comment has been minimized.
1.6 is due for release in about a week. At this point, I should also mention a lot of things like do/until are not shown here. $foo variables no longer are also no longer valid syntax in 1.6 (devel branch, releasing very soon) Please consult http://docs.ansible.com/ for all the latest |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
@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? |
This comment has been minimized.
This comment has been minimized.
Wicked useful, thank you! |
This comment has been minimized.
This comment has been minimized.
An insanely great job ;) |
This comment has been minimized.
This comment has been minimized.
Nice collection! |
This comment has been minimized.
This comment has been minimized.
I just started to learn ansible but would suggest the following modifications:
|
This comment has been minimized.
This comment has been minimized.
hi, handlers:
|
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
This would be really cool to evolve and keep up to date to showcase a detailed changelog. |
This comment has been minimized.
This comment has been minimized.
Great Playbook. A lot of things are clear to me now. |
This comment has been minimized.
This comment has been minimized.
should be part of the core documentation. thanks! |
This comment has been minimized.
This comment has been minimized.
Amazing! edit: And thanks, @marktheunissen! |
This comment has been minimized.
This comment has been minimized.
In term of using variable in hosts attribute (line 58) hosts: $groups -- apply to all hosts specified in the variable $groupsREVISE: $ ansible-playbook playbook1.yml -e "group=myservers" |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
which editor u use for yaml? |
This comment has been minimized.
This comment has been minimized.
@antoniopinarella you can use any text editor. I use vim for .yml and it works fine. |
This comment has been minimized.
This comment has been minimized.
Can we please bury this Gist? it keeps showing up as clickbait in search engines while the syntax is horribly outdated. |
This comment has been minimized.
This comment has been minimized.
I love this, please include "become" |
This comment has been minimized.
This comment has been minimized.
I have made a fork and updated some of the content that has been deprecated. |
This comment has been minimized.
And THAT is how you make nice things!