1TABOOT-TASKS(5) Taboot TABOOT-TASKS(5)
2
3
4
6 taboot-tasks - quick reference for the built in tasks
7
9 Taboot is a tool written for scripting and automating the task of
10 performing software releases in a large-scale infrastructure. Release
11 scripts are written using YAML syntax.
12
13 Taboot tasks are pre-written actions to perform on a given host. For
14 example, scheduling downtime in Nagios, or updating all the RPMs on a
15 system. The tasks documented here can be used in preflight and tasks
16 blocks. The syntax of each possible tasks varies. Taboot comes with
17 many built-in tasks.
18
19 This quick-reference is example based and only uses abbreviated forms
20 where possible. Additionally, the options for the output block are
21 provided.
22
24 The output block lets you choose zero or more methods to log the taboot
25 run. The CLIOutput method is the default. See the online documentation
26 to learn how to set system-wide defaults for the HTMLOutput logger.
27
28 ---
29 - hosts: [www0*.company.com]
30 output:
31 # CLIOutput is the default
32 - CLIOutput
33 # You can also log to a file, 'taboot-YYYY-MM-DD-HHMMSS.log' is
34 # the default format
35 - LogOutput
36 # The 'logfile' keyword lets you choose a different name
37 - LogOutput: {logfile: update-httpd.log}
38 # Log to an HTML file ('taboot-%s.html')
39 - HTMLOutput
40 # As above, but put the logfile in the webservers log directory
41 - HTMLOutput: {destdir: /var/www/html/logs}
42 # HTML output again, but with a named file
43 - HTMLOutput: {logfile: update-httpd.html}
44 # HTML output where *%s* is substituted with a datestamp in the
45 # form YYYY-MM-DD-HHMMSS
46 - HTMLOutput: {logfile: update-httpd-%s.html}
47
49 The Command class lets you run arbitrary commands on the remote host.
50
51 ---
52 - hosts: [www0*.company.com]
53 tasks:
54 # Install httpd on all matching hosts
55 - command.Run: {command: yum -y install httpd}
56
58 The Service class provides an interface to the system service command.
59
60 ---
61 - hosts: [www0*.company.com]
62 tasks:
63 # Start httpd on all matching hosts
64 - service.Start: {service: httpd}
65 # Stop httpd on all matching hosts
66 - service.Stop: {service: httpd}
67 # Restart httpd on all matching hosts
68 - service.Restart: {service: httpd}
69
71 The Puppet class provides a uniform way to interact with the puppet
72 service. This includes enabling/disabling the daemon and manually
73 forcing a catalog run.
74
75 ---
76 - hosts: [www0*.company.com]
77 tasks:
78 # Enable puppet
79 - puppet.Enable
80 # Disable puppet
81 - puppet.Disable
82 # Delete that stubborn lockfile
83 - puppet.DeleteLockfile
84 # Test run
85 - puppet.Run
86 # Test run with specified server
87 - puppet.Run: {server: my.puppet.server}
88 # No operation run
89 - puppet.Run: {noop: true}
90 # Do a paranoid test run (quit Taboot on possible errors)
91 - puppet.SafeRun
92 # Do a paranoid test run with specified server
93 - puppet.SafeRun: {server: my.puppet.server}
94 # Do a noop (dry-run)
95 - puppet.Run: {noop: True}
96
98 The Nagios class lets you handle notifications and set downtime from
99 your Taboot scripts.
100
101 ---
102 - hosts: [www0*.company.com]
103 tasks:
104 # Disable alerts for all matching hosts
105 - nagios.DisableAlerts:
106 nagios_url: nagios.example.com
107 # Enable alerts for all matching hosts
108 - nagios.EnableAlerts:
109 nagios_url: nagios.example.com
110 # Schedule a 60 minute downtime for httpd, git and XMLRPC on
111 # all matching hosts
112 - nagios.ScheduleDowntime:
113 nagios_url: nagios.example.com
114 service: [httpd, git, XMLRPC]
115 minutes: 60
116 # Silence all host and service notifications
117 - nagios.SilenceHost:
118 nagios_url: nagios.example.com
119 # Unsilence all host and service notifications
120 - nagios.UnsilenceHost:
121 nagios_url: nagios.example.com
122
124 The Sleep class is used to halt further task processing for a specified
125 period of time.
126
127 ---
128 - hosts: [www0*.company.com]
129 tasks:
130 # Pauses execution for 5 minutes
131 - sleep.Seconds: {seconds: 300}
132 # Also pauses execution for 5 minutes
133 - sleep.Minutes: {minutes: 5}
134 # Pauses execution until the user presses Enter
135 - sleep.WaitOnInput
136 # Also pauses execution until user presses Enter
137 # but also allows you to override the message prompt
138 - sleep.WaitOnInput: {message: "This is the user prompt:"}
139
141 The Yum class lets you install, remove, and update RPMs right in your
142 Taboot scripts.
143
144 ---
145 - hosts: [www0*.company.com]
146 tasks:
147 # Install three packages
148 - yum.Install: {packages: [httpd, php5, screen]}
149 # Remove the same three packages
150 - yum.Remove: {packages: [httpd, php5, screen]}
151 # Update the same three packages
152 - yum.Update: {packages: [httpd, php5, screen]}
153
155 The RPM class provides two utility actions that, when used together,
156 report any RPMs that changed between the PreManifest and PostManifest.
157
158 ---
159 - hosts: [www0*.company.com]
160 tasks:
161 # Take a PreManifest of all installed packages
162 - rpm.PreManifest
163 # Use yum to update all the system RPMs.
164 - yum.Update
165 # Take a PostManifest and diff it against the PreManifest
166 # The diff is printed after PostManifest finishes running.
167 - rpm.PostManifest
168
170 The AJP class provides a uniform way to put nodes into and out of
171 rotation in a mod_jk AJP balancer. This module is a great replacement
172 for manually adding and removing nodes in a jkmanage management panel.
173
174 ---
175 - hosts: [tomcat*.int.company.com]
176 tasks:
177 # Take the matching node out of rotation
178 - mod_jk.OutOfRotation:
179 proxies:
180 - proxyjava01.web.prod.int.example.com
181 - proxyjava02.web.prod.int.example.com
182 # Do stuff....
183 # do more stuff...
184 # Put the node back into the pool
185 - mod_jk.InRotation:
186 proxies:
187 - proxyjava01.web.prod.int.example.com
188 - proxyjava02.web.prod.int.example.com
189
191 The MISC class has two simple tasks in it: Noop and Echo. They are
192 primarily intended for instruction and as placeholders while testing
193 scripts or major code changes.
194
195 ---
196 - hosts: [www0*.company.com]
197 tasks:
198 # Do nothing
199 - misc.Noop
200 # Echo back the 'input'
201 - misc.Echo: {input: "Taboot Rules!"}
202
204 Taboot was originally written by John Eckersberg. Tim Bielawa is the
205 current maintainer. See the AUTHORS file for a complete list of
206 contributors.
207
209 Copyright © 2009-2011, Red Hat, Inc
210
211 Taboot is released under the terms of the GPLv3+ license.
212
214 taboot(1), func(1)
215
216 Taboot home page: https://fedorahosted.org/Taboot/
217
218 HTML Docs:
219 http://people.redhat.com/~tbielawa/taboot/docs/taboot-latest/tasks.html
220
221
222
223Taboot 0.4.x 01/12/2012 TABOOT-TASKS(5)