mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Compress the playbook format for readability
This commit is contained in:
parent
b053df4182
commit
6d0fd2bfde
2 changed files with 10 additions and 15 deletions
|
@ -1,28 +1,22 @@
|
||||||
- pattern: '*'
|
- pattern: '*'
|
||||||
tasks:
|
tasks:
|
||||||
- do:
|
|
||||||
- copy a file
|
|
||||||
- copy
|
|
||||||
- [ "/srv/a", "/srv/b" ]
|
|
||||||
- do:
|
- do:
|
||||||
- configure template & module variables
|
- configure template & module variables
|
||||||
- setup
|
- [ setup, [ "a=2", "b=3", "c=4" ] ]
|
||||||
- [ "a=2", "b=3", "c=4" ]
|
- do:
|
||||||
|
- copy a file
|
||||||
|
- [ copy, [ "/srv/a", "/srv/b" ] ]
|
||||||
- do:
|
- do:
|
||||||
- template from local file template.j2 to remote location /srv/file.out
|
- template from local file template.j2 to remote location /srv/file.out
|
||||||
- template
|
- [ template, [ '/srv/template.j2', '/srv/file.out' ] ]
|
||||||
- [ '/srv/template.j2', '/srv/file.out' ]
|
|
||||||
- do:
|
- do:
|
||||||
- update apache
|
- update apache
|
||||||
- command
|
- [ command, [/usr/bin/yum, update, apache] ]
|
||||||
- [/usr/bin/yum, update, apache]
|
|
||||||
onchange:
|
onchange:
|
||||||
- do:
|
- do:
|
||||||
- restart apache
|
- restart apache
|
||||||
- command
|
- [ command, [/sbin/service, apache, restart] ]
|
||||||
- [/sbin/service, apache, restart]
|
|
||||||
- do:
|
- do:
|
||||||
- run bin false
|
- run bin false
|
||||||
- command
|
- [ command, [/bin/false] ]
|
||||||
- [/bin/false]
|
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,8 @@ class PlayBook(object):
|
||||||
host_list = self.host_list
|
host_list = self.host_list
|
||||||
|
|
||||||
instructions = task['do']
|
instructions = task['do']
|
||||||
(comment, module_name, module_args) = instructions
|
(comment, module_details) = instructions
|
||||||
|
(module_name, module_args) = module_details
|
||||||
|
|
||||||
namestr = "%s/%s" % (pattern, comment)
|
namestr = "%s/%s" % (pattern, comment)
|
||||||
if conditional:
|
if conditional:
|
||||||
|
|
Loading…
Reference in a new issue