├── .gitmodules ├── LICENSE ├── README.md ├── ansible.el ├── dict └── ansible ├── lib └── generate.rb └── snippets ├── text-mode └── ansible │ ├── a10 │ ├── a10_server │ ├── a10_service_group │ └── a10_virtual_server │ ├── amazon │ ├── cloudformation │ ├── ec2 │ ├── ec2_ami │ ├── ec2_ami_search │ ├── ec2_asg │ ├── ec2_eip │ ├── ec2_elb │ ├── ec2_elb_lb │ ├── ec2_facts │ ├── ec2_group │ ├── ec2_instance │ ├── ec2_instance_info │ ├── ec2_key │ ├── ec2_lc │ ├── ec2_metric_alarm │ ├── ec2_scaling_policy │ ├── ec2_snapshot │ ├── ec2_tag │ ├── ec2_vol │ ├── ec2_vpc │ ├── elasticache │ ├── rds │ ├── rds_param_group │ ├── rds_subnet_group │ ├── route53 │ └── s3 │ ├── azure │ └── azure │ ├── basics │ ├── get_url │ ├── slurp │ └── uri │ ├── citrix │ └── netscaler │ ├── commands │ ├── command │ ├── raw │ ├── script │ └── shell │ ├── digital_ocean │ ├── digital_ocean │ ├── digital_ocean_domain │ └── digital_ocean_sshkey │ ├── docker │ ├── _docker_image │ └── docker │ ├── f5 │ ├── bigip_facts │ ├── bigip_monitor_http │ ├── bigip_monitor_tcp │ ├── bigip_node │ ├── bigip_pool │ └── bigip_pool_member │ ├── files │ ├── acl │ ├── assemble │ ├── copy │ ├── fetch │ ├── file │ ├── ini_file │ ├── lineinfile │ ├── replace │ ├── stat │ ├── synchronize │ ├── template │ ├── unarchive │ └── xattr │ ├── google │ ├── gc_storage │ ├── gce │ ├── gce_lb │ ├── gce_net │ └── gce_pd │ ├── helper │ ├── accelerate │ └── fireball │ ├── inventory │ ├── add_host │ └── group_by │ ├── language │ ├── composer │ ├── cpanm │ ├── easy_install │ ├── gem │ ├── npm │ └── pip │ ├── linode │ └── linode │ ├── logic │ ├── assert │ ├── async_status │ ├── debug │ ├── fail │ ├── include_vars │ ├── pause │ ├── set_fact │ └── wait_for │ ├── messaging │ ├── rabbitmq_parameter │ ├── rabbitmq_plugin │ ├── rabbitmq_policy │ ├── rabbitmq_user │ └── rabbitmq_vhost │ ├── misc │ ├── mongodb_user │ ├── ovirt │ ├── redis │ ├── riak │ └── virt │ ├── monitoring │ ├── airbrake_deployment │ ├── bigpanda │ ├── boundary_meter │ ├── datadog_event │ ├── librato_annotation │ ├── logentries │ ├── monit │ ├── nagios │ ├── newrelic_deployment │ ├── pagerduty │ ├── pingdom │ ├── rollbar_deployment │ ├── stackdriver │ └── zabbix_maintenance │ ├── mysql │ ├── mysql_db │ ├── mysql_replication │ ├── mysql_user │ └── mysql_variables │ ├── network │ ├── dnsimple │ ├── dnsmadeeasy │ ├── lldp │ ├── openvswitch_bridge │ └── openvswitch_port │ ├── notification │ ├── campfire │ ├── flowdock │ ├── grove │ ├── hipchat │ ├── irc │ ├── jabber │ ├── mail │ ├── mqtt │ ├── nexmo │ ├── osx_say │ ├── slack │ ├── sns │ ├── twilio │ └── typetalk │ ├── openstack │ ├── glance_image │ ├── keystone_user │ ├── nova_compute │ ├── nova_keypair │ ├── quantum_floating_ip │ ├── quantum_floating_ip_associate │ ├── quantum_network │ ├── quantum_router │ ├── quantum_router_gateway │ ├── quantum_router_interface │ └── quantum_subnet │ ├── os │ ├── apt │ ├── apt_key │ ├── apt_repository │ ├── apt_rpm │ ├── homebrew │ ├── homebrew_cask │ ├── homebrew_tap │ ├── layman │ ├── macports │ ├── openbsd_pkg │ ├── opkg │ ├── pacman │ ├── pkgin │ ├── pkgng │ ├── pkgutil │ ├── portage │ ├── portinstall │ ├── redhat_subscription │ ├── rhn_channel │ ├── rhn_register │ ├── rpm_key │ ├── svr4pkg │ ├── swdepot │ ├── urpmi │ ├── yum │ ├── zypper │ └── zypper_repository │ ├── postgresql │ ├── postgresql_db │ ├── postgresql_privs │ └── postgresql_user │ ├── rackspace │ ├── rax │ ├── rax_cbs │ ├── rax_cbs_attachments │ ├── rax_cdb │ ├── rax_cdb_database │ ├── rax_cdb_user │ ├── rax_clb │ ├── rax_clb_nodes │ ├── rax_dns │ ├── rax_dns_record │ ├── rax_facts │ ├── rax_files │ ├── rax_files_objects │ ├── rax_identity │ ├── rax_keypair │ ├── rax_meta │ ├── rax_network │ ├── rax_queue │ ├── rax_scaling_group │ └── rax_scaling_policy │ ├── source_control │ ├── bzr │ ├── git │ ├── github_hooks │ ├── hg │ └── subversion │ ├── system │ ├── alternatives │ ├── at │ ├── authorized_key │ ├── capabilities │ ├── cron │ ├── debconf │ ├── facter │ ├── filesystem │ ├── firewalld │ ├── getent │ ├── group │ ├── hostname │ ├── kernel_blacklist │ ├── locale_gen │ ├── lvg │ ├── lvol │ ├── modprobe │ ├── mount │ ├── ohai │ ├── open_iscsi │ ├── ping │ ├── seboolean │ ├── selinux │ ├── service │ ├── setup │ ├── sysctl │ ├── ufw │ ├── user │ └── zfs │ ├── vmware │ └── vsphere_guest │ ├── web_infrastructure │ ├── apache2_module │ ├── django_manage │ ├── ejabberd_user │ ├── htpasswd │ ├── jboss │ ├── jira │ └── supervisorctl │ └── windows │ ├── win_feature │ ├── win_get_url │ ├── win_group │ ├── win_msi │ ├── win_ping │ ├── win_service │ ├── win_stat │ └── win_user └── yaml-mode └── .yas-parents /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/ansible"] 2 | path = lib/ansible 3 | url = https://github.com/ansible/ansible.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible minor mode 2 | 3 | Development of this package has moved to [GitLab](https://gitlab.com/emacs-ansible/emacs-ansible). 4 | -------------------------------------------------------------------------------- /ansible.el: -------------------------------------------------------------------------------- 1 | ;;; ansible.el --- Ansible minor mode 2 | ;; -*- Mode: Emacs-Lisp -*- 3 | 4 | ;; Copyright (C) 2014 by 101000code/101000LAB 5 | 6 | ;; This program is free software; you can redistribute it and/or modify 7 | ;; it under the terms of the GNU General Public License as published by 8 | ;; the Free Software Foundation; either version 2 of the License, or 9 | ;; (at your option) any later version. 10 | 11 | ;; This program is distributed in the hope that it will be useful, 12 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ;; GNU General Public License for more details. 15 | 16 | ;; You should have received a copy of the GNU General Public License 17 | ;; along with this program; if not, write to the Free Software 18 | ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | ;; Version: 0.3.2 21 | ;; Author: k1LoW (Kenichirou Oyama), 22 | ;; URL: https://github.com/k1LoW/emacs-ansible 23 | ;; Package-Requires: ((s "1.9.0") (f "0.16.2")) 24 | 25 | ;;; Install 26 | ;; Put this file into load-path'ed directory, and byte compile it if 27 | ;; desired. And put the following expression into your ~/.emacs. 28 | ;; 29 | ;; (require 'ansible) 30 | 31 | ;;; Commentary: 32 | ;; This is minor-mode for editing ansible files. 33 | 34 | ;;; Commands: 35 | ;; 36 | ;; Below are complete command list: 37 | ;; 38 | ;; `ansible' 39 | ;; Ansible minor mode. 40 | ;; 41 | ;;; Customizable Options: 42 | ;; 43 | ;; Below are customizable option list: 44 | ;; 45 | ;; `ansible-dir-search-limit' 46 | ;; Search limit 47 | ;; default = 5 48 | 49 | ;;; Code: 50 | 51 | ;;require 52 | (require 's) 53 | (require 'f) 54 | 55 | ;; the 'cl package has been deprecated in favour of 'cl-lib. Load 'cl 56 | ;; on emacs < 26, otherwise load 'cl-lib. 57 | (eval-when-compile 58 | (if (version< emacs-version "26") 59 | (require 'cl) 60 | (require 'cl-lib))) 61 | 62 | (require 'easy-mmode) 63 | 64 | (defgroup ansible nil 65 | "Ansible minor mode" 66 | :group 'languages 67 | :prefix "ansible-") 68 | 69 | (defcustom ansible-dir-search-limit 5 70 | "Search limit." 71 | :type 'integer 72 | :group 'ansible) 73 | 74 | (defcustom ansible-vault-password-file "~/.vault_pass.txt" 75 | "Filename containing ansible-vault password." 76 | :type 'file 77 | :group 'ansible) 78 | 79 | ;;;###autoload 80 | (defvar ansible-key-map 81 | (make-sparse-keymap) 82 | "Keymap for Ansible.") 83 | 84 | (defvar ansible-root-path nil 85 | "Ansible spec directory path.") 86 | 87 | (defvar ansible-hook nil 88 | "Hook.") 89 | 90 | (defvar ansible-section-face 'ansible-section-face) 91 | (defface ansible-section-face 92 | '((((class color) (min-colors 88) (background dark)) :foreground "indian red" )) 93 | "Face for ansible first level section names (i.e.: vars, tasks, handlers) in playbooks." 94 | :group 'ansible) 95 | 96 | (defvar ansible-task-label-face 'ansible-task-label-face) 97 | (defface ansible-task-label-face 98 | '((((class color) (min-colors 88) (background dark)) :foreground "green" )) 99 | "Face for ansible task names in playbooks" 100 | :group 'ansible) 101 | 102 | (defconst ansible-section-keywords-regex 103 | (concat 104 | "^ *-? " 105 | (regexp-opt 106 | '("hosts" "vars" "vars_prompt" "vars_files" "role" "include" "include_tasks" 107 | "roles" "tasks" "import_tasks" "handlers" "pre_tasks" "post_tasks" "environment" ) t) 108 | ":") 109 | "Special keywords used to identify toplevel information in a playbook.") 110 | 111 | (defconst ansible-task-keywords-regex 112 | (concat 113 | "^ *-? " 114 | (regexp-opt 115 | '("a10_server" "a10_service_group" "a10_virtual_server" "acl" "add_host" 116 | "airbrake_deployment" "alternatives" "apache2_module" "apk" "apt" "apt_key" 117 | "apt_repository" "apt_rpm" "assemble" "assert" "async_status" "at" "authorized_key" 118 | "azure" "azure_rm_deployment" "azure_rm_networkinterface" 119 | "azure_rm_networkinterface_facts" "azure_rm_publicipaddress" 120 | "azure_rm_publicipaddress_facts" "azure_rm_resourcegroup" 121 | "azure_rm_resourcegroup_facts" "azure_rm_securitygroup" 122 | "azure_rm_securitygroup_facts" "azure_rm_storageaccount" 123 | "azure_rm_storageaccount_facts" "azure_rm_storageblob" "azure_rm_subnet" 124 | "azure_rm_virtualmachine" "azure_rm_virtualmachineimage_facts" 125 | "azure_rm_virtualnetwork" "azure_rm_virtualnetwork_facts" "bigip_facts" 126 | "bigip_gtm_wide_ip" "bigip_monitor_http" "bigip_monitor_tcp" "bigip_node" 127 | "bigip_pool" "bigip_pool_member" "bigip_virtual_server" "bigpanda" "blockinfile" 128 | "boundary_meter" "bower" "bundler" "bzr" "campfire" "capabilities" 129 | "circonus_annotation" "cl_bond" "cl_bridge" "cl_img_install" "cl_interface" 130 | "cl_interface_policy" "cl_license" "cl_ports" "clc_aa_policy" "clc_alert_policy" 131 | "clc_blueprint_package" "clc_firewall_policy" "clc_group" "clc_loadbalancer" 132 | "clc_modify_server" "clc_publicip" "clc_server" "clc_server_snapshot" 133 | "cloudflare_dns" "cloudformation" "cloudtrail" "command" "composer" "consul" 134 | "consul_acl" "consul_kv" "consul_session" "copy" "cpanm" "cron" "cronvar" "crypttab" 135 | "cs_account" "cs_affinitygroup" "cs_cluster" "cs_configuration" "cs_domain" 136 | "cs_facts" "cs_firewall" "cs_instance" "cs_instance_facts" "cs_instancegroup" 137 | "cs_ip_address" "cs_iso" "cs_loadbalancer_rule" "cs_loadbalancer_rule_member" 138 | "cs_network" "cs_pod" "cs_portforward" "cs_project" "cs_resourcelimit" 139 | "cs_securitygroup" "cs_securitygroup_rule" "cs_sshkeypair" "cs_staticnat" 140 | "cs_template" "cs_user" "cs_vmsnapshot" "cs_volume" "cs_zone" "cs_zone_facts" 141 | "datadog_event" "datadog_monitor" "debconf" "debug" "deploy_helper" "digital_ocean" 142 | "digital_ocean_domain" "digital_ocean_sshkey" "django_manage" "dnf" "dnsimple" 143 | "dnsmadeeasy" "docker" "docker_container" "docker_image" "docker_image_facts" 144 | "docker_login" "docker_service" "dpkg_selections" "dynamodb_table" "easy_install" 145 | "ec2" "ec2_ami" "ec2_ami_copy" "ec2_ami_find" "ec2_asg" "ec2_eip" "ec2_elb" 146 | "ec2_elb_facts" "ec2_elb_lb" "ec2_eni" "ec2_eni_facts" "ec2_facts" "ec2_group" 147 | "ec2_instance" "ec2_instance_info" 148 | "ec2_key" "ec2_lc" "ec2_metric_alarm" "ec2_remote_facts" "ec2_scaling_policy" 149 | "ec2_snapshot" "ec2_snapshot_facts" "ec2_tag" "ec2_vol" "ec2_vol_facts" "ec2_vpc" 150 | "ec2_vpc_dhcp_options" "ec2_vpc_igw" "ec2_vpc_net" "ec2_vpc_net_facts" 151 | "ec2_vpc_route_table" "ec2_vpc_route_table_facts" "ec2_vpc_subnet" 152 | "ec2_vpc_subnet_facts" "ec2_win_password" "ecs_cluster" "ecs_service" 153 | "ecs_service_facts" "ecs_task" "ecs_taskdefinition" "ejabberd_user" "elasticache" 154 | "elasticache_subnet_group" "elasticsearch_plugin" "eos_command" "eos_config" 155 | "eos_eapi" "eos_template" "expect" "facter" "fail" "fetch" "file" "filesystem" 156 | "find" "firewalld" "flowdock" "gc_storage" "gce" "gce_img" "gce_lb" "gce_net" 157 | "gce_pd" "gce_tag" "gem" "get_url" "getent" "git" "git_config" "github_hooks" 158 | "gitlab_group" "gitlab_project" "gitlab_user" "gluster_volume" "group" "group_by" 159 | "grove" "hall" "haproxy" "hg" "hipchat" "homebrew" "homebrew_cask" "homebrew_tap" 160 | "hostname" "htpasswd" "iam" "iam_cert" "iam_policy" "include_vars" 161 | "influxdb_database" "influxdb_retention_policy" "ini_file" "ios_command" 162 | "ios_config" "ios_template" "iosxr_command" "iosxr_config" "iosxr_template" 163 | "ipify_facts" "iptables" "irc" "jabber" "jboss" "jira" "junos_command" 164 | "junos_config" "junos_facts" "junos_netconf" "junos_package" "junos_template" 165 | "kernel_blacklist" "known_hosts" "kubernetes" "layman" "librato_annotation" 166 | "lineinfile" "linode" "lldp" "locale_gen" "logentries" "lvg" "lvol" "lxc_container" 167 | "macports" "mail" "make" "maven_artifact" "modprobe" "mongodb_parameter" 168 | "mongodb_user" "monit" "mount" "mqtt" "mysql_db" "mysql_replication" "mysql_user" 169 | "mysql_variables" "nagios" "netscaler" "newrelic_deployment" "nexmo" "nmcli" "npm" 170 | "nxos_command" "nxos_config" "nxos_facts" "nxos_feature" "nxos_interface" 171 | "nxos_ip_interface" "nxos_nxapi" "nxos_ping" "nxos_switchport" "nxos_template" 172 | "nxos_vlan" "nxos_vrf" "nxos_vrf_interface" "nxos_vrrp" "ohai" "open_iscsi" 173 | "openbsd_pkg" "openvswitch_bridge" "openvswitch_db" "openvswitch_port" "opkg" 174 | "ops_command" "ops_config" "ops_facts" "ops_template" "os_auth" "os_client_config" 175 | "os_flavor_facts" "os_floating_ip" "os_group" "os_image" "os_image_facts" 176 | "os_ironic" "os_ironic_inspect" "os_ironic_node" "os_keypair" "os_keystone_domain" 177 | "os_keystone_domain_facts" "os_keystone_role" "os_network" "os_networks_facts" 178 | "os_nova_flavor" "os_object" "os_port" "os_port_facts" "os_project" 179 | "os_project_facts" "os_router" "os_security_group" "os_security_group_rule" 180 | "os_server" "os_server_actions" "os_server_facts" "os_server_volume" "os_subnet" 181 | "os_subnets_facts" "os_user" "os_user_facts" "os_user_group" "os_user_role" 182 | "os_volume" "osx_defaults" "osx_say" "ovirt" "package" "pacman" "pagerduty" 183 | "pagerduty_alert" "pam_limits" "patch" "pause" "pear" "ping" "pingdom" "pip" "pkg5" 184 | "pkg5_publisher" "pkgin" "pkgng" "pkgutil" "portage" "portinstall" "postgresql_db" 185 | "postgresql_ext" "postgresql_lang" "postgresql_privs" "postgresql_user" 186 | "profitbricks" "profitbricks_datacenter" "profitbricks_nic" "profitbricks_volume" 187 | "profitbricks_volume_attachments" "proxmox" "proxmox_template" "puppet" "pushbullet" 188 | "pushover" "rabbitmq_binding" "rabbitmq_exchange" "rabbitmq_parameter" 189 | "rabbitmq_plugin" "rabbitmq_policy" "rabbitmq_queue" "rabbitmq_user" 190 | "rabbitmq_vhost" "raw" "rax" "rax_cbs" "rax_cbs_attachments" "rax_cdb" 191 | "rax_cdb_database" "rax_cdb_user" "rax_clb" "rax_clb_nodes" "rax_clb_ssl" "rax_dns" 192 | "rax_dns_record" "rax_facts" "rax_files" "rax_files_objects" "rax_identity" 193 | "rax_keypair" "rax_meta" "rax_mon_alarm" "rax_mon_check" "rax_mon_entity" 194 | "rax_mon_notification" "rax_mon_notification_plan" "rax_network" "rax_queue" 195 | "rax_scaling_group" "rax_scaling_policy" "rds" "rds_param_group" "rds_subnet_group" 196 | "redhat_subscription" "redis" "replace" "rhn_channel" "rhn_register" "riak" 197 | "rollbar_deployment" "route53" "route53_facts" "route53_health_check" "route53_zone" 198 | "rpm_key" "s3" "s3_bucket" "s3_lifecycle" "s3_logging" "script" "seboolean" 199 | "selinux" "selinux_permissive" "sendgrid" "sensu_check" "seport" "service" 200 | "set_fact" "setup" "shell" "sl_vm" "slack" "slackpkg" "slurp" "snmp_facts" "sns" 201 | "sns_topic" "solaris_zone" "sqs_queue" "stackdriver" "stat" "sts_assume_role" 202 | "subversion" "supervisorctl" "svc" "svr4pkg" "swdepot" "synchronize" "sysctl" "systemd" 203 | "taiga_issue" "template" "twilio" "typetalk" "ufw" "unarchive" "uptimerobot" "uri" 204 | "urpmi" "user" "vca_fw" "vca_nat" "vca_vapp" "vertica_configuration" "vertica_facts" 205 | "vertica_role" "vertica_schema" "vertica_user" "virt" "virt_net" "virt_pool" 206 | "vmware_cluster" "vmware_datacenter" "vmware_dns_config" "vmware_dvs_host" 207 | "vmware_dvs_portgroup" "vmware_dvswitch" "vmware_host" "vmware_maintenancemode" 208 | "vmware_migrate_vmk" "vmware_portgroup" "vmware_target_canonical_facts" 209 | "vmware_vm_facts" "vmware_vm_shell" "vmware_vm_vss_dvs_migrate" "vmware_vmkernel" 210 | "vmware_vmkernel_ip_config" "vmware_vsan_cluster" "vmware_vswitch" "vsphere_copy" 211 | "vsphere_guest" "wait_for" "webfaction_app" "webfaction_db" "webfaction_domain" 212 | "webfaction_mailbox" "webfaction_site" "win_acl" "win_acl_inheritance" 213 | "win_chocolatey" "win_copy" "win_dotnet_ngen" "win_environment" "win_feature" 214 | "win_file" "win_file_version" "win_firewall_rule" "win_get_url" "win_group" 215 | "win_iis_virtualdirectory" "win_iis_webapplication" "win_iis_webapppool" 216 | "win_iis_webbinding" "win_iis_website" "win_lineinfile" "win_msi" "win_nssm" 217 | "win_owner" "win_package" "win_ping" "win_reboot" "win_regedit" "win_regmerge" 218 | "win_scheduled_task" "win_service" "win_share" "win_stat" "win_template" 219 | "win_timezone" "win_unzip" "win_updates" "win_uri" "win_user" "win_webpicmd" "xattr" 220 | "xenserver_facts" "yum" "yum_repository" "zabbix_group" "zabbix_host" 221 | "zabbix_hostmacro" "zabbix_maintenance" "zabbix_screen" "zfs" "znode" "zypper" 222 | "zypper_repository") t) 223 | ":") 224 | "List of ansible task names.") 225 | 226 | (defconst ansible-keywords-regex 227 | (concat 228 | "^ +" 229 | (regexp-opt 230 | '("with_items" "with_dict" "with_nested" "with_first_found" "with_fileglob" 231 | "with_together" "with_subelements" "with_sequence" "with_random_choice" "until" 232 | "retries" "delay" "with_lines" "with_indexed_items" "with_ini" "with_flattened" 233 | "with_inventory_hostnames" "when" "notify" "register" "tags" "gather_facts" 234 | "connection" "tags" "become" "become_user" "args" "local_action" "delegate_to" 235 | "strategy") t) 236 | ":") 237 | "Ansible keywords used with tasks.") 238 | 239 | 240 | (defvar ansible-playbook-font-lock 241 | `(("\\({{\\)\\([^}]+\\)\\(}}\\)" 242 | (1 font-lock-builtin-face t) 243 | (2 font-lock-function-name-face t) 244 | (3 font-lock-builtin-face t)) 245 | (,ansible-section-keywords-regex (1 ansible-section-face t)) 246 | (,ansible-task-keywords-regex (1 font-lock-keyword-face t)) 247 | ("^ *- \\(name\\):\\([^#\n]*\\)" 248 | (1 font-lock-builtin-face t) 249 | (2 ansible-task-label-face t)) 250 | (,ansible-keywords-regex (1 font-lock-builtin-face t))) 251 | "Font lock definitions for ansible playbooks.") 252 | 253 | 254 | (defun ansible-add-font-lock() 255 | "Extend YAML with syntax highlight for ansible playbooks." 256 | (interactive) 257 | (font-lock-add-keywords 'nil ansible-playbook-font-lock 'append) 258 | (font-lock-flush)) 259 | 260 | (defun ansible-remove-font-lock() 261 | "Add syntax highlight to ansible playbooks." 262 | (interactive) 263 | (font-lock-remove-keywords 'nil ansible-playbook-font-lock) 264 | (font-lock-flush)) 265 | 266 | (defun ansible-maybe-unload-snippets(&optional buffer-count) 267 | "Unload ansible snippets in case no other ansible buffers exists." 268 | ;; mitigates: https://github.com/k1LoW/emacs-ansible/issues/5 269 | (when (and (featurep 'yasnippet) 270 | (= (or buffer-count 1) ;when called via kill-hook, the buffer is still existent 271 | (seq-count (lambda (b) (with-current-buffer b ansible)) (buffer-list)))) 272 | (setq yas-snippet-dirs (delete ansible-snip-dir yas-snippet-dirs)) 273 | (yas-reload-all))) 274 | 275 | ;;;###autoload 276 | (define-minor-mode ansible 277 | "Ansible minor mode." 278 | :lighter " Ansible" 279 | :group 'ansible 280 | (if ansible 281 | (progn 282 | (setq minor-mode-map-alist 283 | (cons (cons 'ansible ansible-key-map) 284 | minor-mode-map-alist)) 285 | (ansible-dict-initialize) 286 | (ansible-remove-font-lock) 287 | (ansible-add-font-lock) 288 | (when (featurep 'yasnippet) 289 | (add-to-list 'yas-snippet-dirs ansible-snip-dir t) 290 | (yas-load-directory ansible-snip-dir)) 291 | (add-hook 'kill-buffer-hook #'ansible-maybe-unload-snippets nil t) 292 | (run-hooks 'ansible-hook)) 293 | (ansible-remove-font-lock) 294 | (ansible-maybe-unload-snippets 0))) 295 | 296 | (defun ansible-update-root-path () 297 | "Update ansible-root-path." 298 | (let ((spec-path (ansible-find-root-path))) 299 | (unless (not spec-path) 300 | (setq ansible-root-path spec-path)) 301 | (when ansible-root-path t))) 302 | 303 | (defun ansible-find-root-path () 304 | "Find ansible directory." 305 | (let ((current-dir (f-expand default-directory))) 306 | (loop with count = 0 307 | until (f-exists? (f-join current-dir "roles")) 308 | ;; Return nil if outside the value of 309 | if (= count ansible-dir-search-limit) 310 | do (return nil) 311 | ;; Or search upper directories. 312 | else 313 | do (incf count) 314 | (unless (f-root? current-dir) 315 | (setq current-dir (f-dirname current-dir))) 316 | finally return current-dir))) 317 | 318 | (defun ansible-list-playbooks () 319 | "Find .yml files in ansible-root-path." 320 | (if (ansible-update-root-path) 321 | (mapcar 322 | (lambda (file) (f-relative file ansible-root-path)) 323 | (f-files ansible-root-path (lambda (file) (s-matches? ".yml" (f-long file))) t)) 324 | nil)) 325 | 326 | (defun ansible-vault-buffer (mode) 327 | "Execute ansible-vault (MODE STR should be 'decrypt' or 'encrypt') and update current buffer." 328 | (let* ((input (buffer-substring-no-properties (point-min) (point-max))) 329 | (output (ansible-vault mode input))) 330 | (delete-region (point-min) (point-max)) 331 | (insert output))) 332 | 333 | (defun ansible-get-string-from-file (file-path) 334 | "Return FILE-PATH's file content." 335 | (with-temp-buffer 336 | (insert-file-contents file-path) 337 | (buffer-string))) 338 | 339 | (defun ansible-vault (mode str) 340 | "Execute ansible-vault (MODE STR should be 'decrypt' or 'encrypt')." 341 | (let ((temp-file (make-temp-file "ansible-vault-ansible"))) 342 | (write-region str nil temp-file 'append) 343 | (let* ((vault-str (if ansible-vault-password-file 344 | (format "--vault-password-file=%s" ansible-vault-password-file) 345 | "")) 346 | (command (format "ansible-vault %s %s %s" 347 | mode vault-str temp-file)) 348 | (status (shell-command command)) 349 | (output (ansible-get-string-from-file temp-file))) 350 | (if (/= status 0) 351 | (error "Error in ansible-vault running %s!" command) 352 | (delete-file temp-file) 353 | output)))) 354 | 355 | (defun ansible-decrypt-buffer () 356 | "Decrypt current buffer." 357 | (interactive) 358 | (ansible-vault-buffer "decrypt") 359 | ;; force buffer to be marked as unmodified 360 | (set-buffer-modified-p nil)) 361 | 362 | (defun ansible-encrypt-buffer () 363 | "Encrypt current buffer." 364 | (interactive) 365 | (ansible-vault-buffer "encrypt")) 366 | 367 | (defconst ansible-dir (file-name-directory (or load-file-name 368 | buffer-file-name))) 369 | 370 | (defconst ansible-snip-dir (expand-file-name "snippets" ansible-dir)) 371 | 372 | (defun ansible-auto-decrypt-encrypt () 373 | "Decrypt current buffer if it is a vault encrypted file. 374 | Also, automatically encrypts the file before saving the buffer." 375 | (let ((vault-file? (string-match-p "\$ANSIBLE_VAULT;[0-9]+\.[0-9]+" 376 | (buffer-substring-no-properties (point-min) 377 | (point-max))))) 378 | (when vault-file? 379 | (condition-case ex 380 | (progn 381 | (ansible-decrypt-buffer) 382 | (add-hook 'before-save-hook 'ansible-encrypt-buffer nil t) 383 | (add-hook 'after-save-hook 'ansible-decrypt-buffer nil t)) 384 | ('error 385 | (message "Could not decrypt file. Make sure `ansible-vault-password-file' or the environment variable ANSIBLE_VAULT_PASSWORD_FILE is correctly set")))))) 386 | 387 | ;;;###autoload 388 | (defun ansible-dict-initialize () 389 | "Initialize Ansible auto-complete." 390 | (let ((dict-dir (expand-file-name "dict" ansible-dir))) 391 | (when (and (f-directory? dict-dir) (boundp 'ac-user-dictionary-files)) 392 | (add-to-list 'ac-user-dictionary-files (f-join dict-dir "ansible") t)))) 393 | 394 | ;;;###ansible-lint 395 | 396 | ; Replace make -k with ansible-lint, with an UTF-8 locale to avoid crashes 397 | (defun ansible-lint-errors () 398 | (make-local-variable 'compile-command) 399 | (let ((ansiblelint_command "ansible-lint ") (loc "LANG=C.UTF-8 ")) 400 | (setq compile-command (concat loc ansiblelint_command buffer-file-name))) 401 | ) 402 | (add-hook 'ansible-hook 'ansible-lint-errors) 403 | 404 | (provide 'ansible) 405 | 406 | ;;; ansible.el ends here 407 | -------------------------------------------------------------------------------- /dict/ansible: -------------------------------------------------------------------------------- 1 | tower_callback 2 | termination_protection 3 | tenancy 4 | security_token 5 | purge_tags 6 | launch_template 7 | instance_role 8 | instance_initiated_shutdown_behavior 9 | ec2_url 10 | detailed_monitoring 11 | debug_botocore_endpoint_logs 12 | cpu_credit_specification 13 | cpu_options 14 | stack_name 15 | disable_rollback 16 | template_parameters 17 | region 18 | state 19 | template 20 | tags 21 | aws_secret_key 22 | aws_access_key 23 | key_name 24 | id 25 | group 26 | group_id 27 | zone 28 | instance_type 29 | spot_price 30 | image 31 | kernel 32 | ramdisk 33 | wait 34 | wait_timeout 35 | spot_wait_timeout 36 | count 37 | monitoring 38 | user_data 39 | instance_tags 40 | placement_group 41 | vpc_subnet_id 42 | assign_public_ip 43 | private_ip 44 | instance_profile_name 45 | instance_ids 46 | source_dest_check 47 | volumes 48 | ebs_optimized 49 | exact_count 50 | count_tag 51 | instance_id 52 | name 53 | description 54 | no_reboot 55 | image_id 56 | delete_snapshot 57 | distro 58 | release 59 | stream 60 | store 61 | arch 62 | virt 63 | load_balancers 64 | availability_zones 65 | launch_config_name 66 | min_size 67 | max_size 68 | desired_capacity 69 | replace_all_instances 70 | replace_batch_size 71 | replace_instances 72 | lc_check 73 | vpc_zone_identifier 74 | health_check_period 75 | health_check_type 76 | public_ip 77 | in_vpc 78 | reuse_existing_ip_allowed 79 | ec2_elbs 80 | enable_availability_zone 81 | validate_certs 82 | listeners 83 | purge_listeners 84 | zones 85 | purge_zones 86 | security_group_ids 87 | security_group 88 | health_check 89 | subnets 90 | purge_subnets 91 | scheme 92 | connection_draining_timeout 93 | cross_az_load_balancing 94 | vpc_id 95 | rules 96 | rules_egress 97 | purge_rules 98 | purge_rules_egress 99 | key_material 100 | security_groups 101 | kernel_id 102 | instance_monitoring 103 | ramdisk_id 104 | metric 105 | namespace 106 | statistic 107 | comparison 108 | threshold 109 | period 110 | evaluation_periods 111 | unit 112 | dimensions 113 | alarm_actions 114 | insufficient_data_actions 115 | ok_actions 116 | asg_name 117 | adjustment_type 118 | scaling_adjustment 119 | min_adjustment_step 120 | cooldown 121 | volume_id 122 | device_name 123 | snapshot_tags 124 | resource 125 | instance 126 | volume_size 127 | iops 128 | encrypted 129 | snapshot 130 | cidr_block 131 | instance_tenancy 132 | dns_support 133 | dns_hostnames 134 | resource_tags 135 | internet_gateway 136 | route_tables 137 | engine 138 | cache_engine_version 139 | node_type 140 | num_nodes 141 | cache_port 142 | cache_security_groups 143 | hard_modify 144 | command 145 | instance_name 146 | source_instance 147 | db_engine 148 | size 149 | username 150 | password 151 | db_name 152 | engine_version 153 | parameter_group 154 | license_model 155 | multi_zone 156 | vpc_security_groups 157 | port 158 | upgrade 159 | option_group 160 | maint_window 161 | backup_window 162 | backup_retention 163 | subnet 164 | apply_immediately 165 | new_instance_name 166 | immediate 167 | params 168 | record 169 | ttl 170 | type 171 | value 172 | overwrite 173 | retry_interval 174 | bucket 175 | object 176 | src 177 | dest 178 | mode 179 | expiration 180 | s3_url 181 | metadata 182 | location 183 | subscription_id 184 | management_cert_path 185 | storage_account 186 | role_size 187 | endpoints 188 | user 189 | ssh_cert_path 190 | virtual_network_name 191 | hostname 192 | wait_timeout_redirects 193 | client_id 194 | api_key 195 | unique_name 196 | size_id 197 | region_id 198 | ssh_key_ids 199 | virtio 200 | private_networking 201 | backups_enabled 202 | ssh_pub_key 203 | ip 204 | path 205 | tag 206 | nocache 207 | docker_url 208 | timeout 209 | ports 210 | expose 211 | publish_all_ports 212 | volumes_from 213 | links 214 | memory_limit 215 | docker_api_version 216 | env 217 | dns 218 | detach 219 | privileged 220 | lxc_conf 221 | stdin_open 222 | tty 223 | net 224 | registry 225 | force 226 | permission 227 | gcs_secret_key 228 | gcs_access_key 229 | instance_names 230 | machine_type 231 | service_account_email 232 | pem_file 233 | project_id 234 | network 235 | persistent_boot_disk 236 | disks 237 | httphealthcheck_name 238 | httphealthcheck_port 239 | httphealthcheck_path 240 | httphealthcheck_interval 241 | httphealthcheck_timeout 242 | httphealthcheck_unhealthy_count 243 | httphealthcheck_healthy_count 244 | httphealthcheck_host 245 | protocol 246 | external_ip 247 | port_range 248 | members 249 | allowed 250 | ipv4_range 251 | fwname 252 | src_range 253 | src_tags 254 | detach_only 255 | size_gb 256 | linode_id 257 | plan 258 | payment_term 259 | swap 260 | distribution 261 | datacenter 262 | login_username 263 | login_password 264 | login_tenant_name 265 | auth_url 266 | region_name 267 | disk_format 268 | container_format 269 | owner 270 | min_disk 271 | min_ram 272 | is_public 273 | copy_from 274 | file 275 | endpoint_type 276 | login_user 277 | token 278 | endpoint 279 | tenant 280 | tenant_description 281 | email 282 | role 283 | image_name 284 | image_exclude 285 | flavor_id 286 | flavor_ram 287 | flavor_include 288 | nics 289 | auto_floating_ip 290 | floating_ips 291 | floating_ip_pools 292 | availability_zone 293 | meta 294 | wait_for 295 | config_drive 296 | public_key 297 | network_name 298 | internal_network_name 299 | ip_address 300 | tenant_name 301 | provider_network_type 302 | provider_physical_network 303 | provider_segmentation_id 304 | router_external 305 | shared 306 | admin_state_up 307 | router_name 308 | subnet_name 309 | cidr 310 | ip_version 311 | enable_dhcp 312 | gateway_ip 313 | dns_nameservers 314 | allocation_pool_start 315 | allocation_pool_end 316 | auto_increment 317 | count_offset 318 | disk_config 319 | extra_client_args 320 | extra_create_args 321 | files 322 | flavor 323 | networks 324 | snapshot_id 325 | volume_type 326 | device 327 | volume 328 | server 329 | cdb_id 330 | character_set 331 | collate 332 | db_username 333 | db_password 334 | databases 335 | host 336 | algorithm 337 | vip_id 338 | address 339 | condition 340 | load_balancer_id 341 | node_id 342 | weight 343 | comment 344 | data 345 | domain 346 | loadbalancer 347 | priority 348 | clear_meta 349 | container 350 | private 351 | public 352 | web_error 353 | web_index 354 | expires 355 | method 356 | structure 357 | label 358 | loadbalancers 359 | max_entities 360 | min_entities 361 | server_name 362 | at 363 | change 364 | cron 365 | is_percent 366 | policy_type 367 | scaling_group 368 | vcenter_hostname 369 | guest 370 | resource_pool 371 | cluster 372 | esxi 373 | vm_disk 374 | vm_hardware 375 | vm_nic 376 | vm_extra_config 377 | vm_hw_version 378 | vmware_guest_facts 379 | free_form 380 | creates 381 | removes 382 | chdir 383 | executable 384 | warn 385 | login_host 386 | login_port 387 | login_unix_socket 388 | collation 389 | encoding 390 | target 391 | priv 392 | append_privs 393 | check_implicit_admin 394 | variable 395 | lc_collate 396 | lc_ctype 397 | database 398 | privs 399 | objs 400 | schema 401 | roles 402 | grant_option 403 | login 404 | db 405 | fail_on_user 406 | role_attr_flags 407 | follow 408 | default 409 | entity 410 | etype 411 | permissions 412 | entry 413 | backup 414 | delimiter 415 | remote_src 416 | regexp 417 | content 418 | validate 419 | directory_mode 420 | fail_on_missing 421 | validate_checksum 422 | flat 423 | recurse 424 | section 425 | option 426 | others 427 | line 428 | backrefs 429 | insertafter 430 | insertbefore 431 | create 432 | replace 433 | get_md5 434 | get_checksum 435 | dest_port 436 | archive 437 | checksum 438 | compress 439 | existing_only 440 | delete 441 | dirs 442 | recursive 443 | copy_links 444 | perms 445 | times 446 | rsync_path 447 | rsync_timeout 448 | set_remote_user 449 | rsync_opts 450 | copy 451 | key 452 | groups 453 | url 454 | sha256sum 455 | use_proxy 456 | url_username 457 | url_password 458 | body 459 | return_content 460 | force_basic_auth 461 | follow_redirects 462 | status_code 463 | HEADER_ 464 | virtualenv 465 | virtualenv_site_packages 466 | virtualenv_command 467 | gem_source 468 | include_dependencies 469 | repository 470 | user_install 471 | version 472 | pre_release 473 | requirements 474 | extra_args 475 | update_cache 476 | cache_valid_time 477 | purge 478 | default_release 479 | install_recommends 480 | dpkg_options 481 | deb 482 | keyring 483 | keyserver 484 | repo 485 | pkg 486 | server_hostname 487 | server_insecure 488 | rhsm_baseurl 489 | autosubscribe 490 | activationkey 491 | pool 492 | sysname 493 | server_url 494 | channels 495 | list 496 | enablerepo 497 | disablerepo 498 | conf_file 499 | disable_gpg_check 500 | accept_hostkey 501 | ssh_opts 502 | key_file 503 | reference 504 | remote 505 | depth 506 | update 507 | bare 508 | track_submodules 509 | revision 510 | export 511 | manage_dir 512 | key_options 513 | job 514 | cron_file 515 | minute 516 | hour 517 | day 518 | month 519 | weekday 520 | reboot 521 | special_time 522 | gid 523 | system 524 | fstype 525 | opts 526 | dump 527 | passno 528 | fstab 529 | persistent 530 | policy 531 | conf 532 | sleep 533 | pattern 534 | enabled 535 | runlevel 536 | arguments 537 | filter 538 | filters 539 | fact_path 540 | ignoreerrors 541 | reload 542 | sysctl_file 543 | sysctl_set 544 | uid 545 | non_unique 546 | append 547 | shell 548 | home 549 | createhome 550 | move_home 551 | login_class 552 | remove 553 | generate_ssh_key 554 | ssh_key_bits 555 | ssh_key_type 556 | ssh_key_file 557 | ssh_key_comment 558 | ssh_key_passphrase 559 | update_password 560 | minutes 561 | ipv6 562 | multi_key 563 | that 564 | jid 565 | msg 566 | var 567 | free-form 568 | seconds 569 | prompt 570 | key_value 571 | delay 572 | search_regex 573 | exclude_hosts 574 | app_path 575 | settings 576 | pythonpath 577 | apps 578 | cache_table 579 | failfast 580 | fixtures 581 | skip 582 | merge 583 | link 584 | crypt_scheme 585 | config 586 | supervisorctl_path 587 | restart 588 | include_sub_features 589 | include_management_tools 590 | start_mode 591 | resource_type 592 | instance_disksize 593 | instance_cpus 594 | instance_nic 595 | instance_network 596 | instance_mem 597 | disk_alloc 598 | disk_int 599 | instance_os 600 | instance_cores 601 | sdomain 602 | uri 603 | xml 604 | replica_set 605 | ssl 606 | master_host 607 | master_port 608 | slave_mode 609 | flush_mode 610 | config_dir 611 | http_conn 612 | target_node 613 | wait_for_handoffs 614 | wait_for_ring 615 | wait_for_service 616 | master_user 617 | master_password 618 | master_connect_retry 619 | master_log_file 620 | master_log_pos 621 | relay_log_file 622 | relay_log_pos 623 | master_ssl 624 | master_ssl_ca 625 | master_ssl_capath 626 | master_ssl_cert 627 | master_ssl_key 628 | master_ssl_cipher 629 | component 630 | vhost 631 | node 632 | names 633 | new_only 634 | prefix 635 | configure_priv 636 | write_priv 637 | read_priv 638 | tracing 639 | environment 640 | hosts 641 | apiid 642 | apikey 643 | title 644 | text 645 | date_happened 646 | alert_type 647 | aggregation_key 648 | source 649 | start_time 650 | end_time 651 | action 652 | cmdfile 653 | author 654 | services 655 | app_name 656 | application_id 657 | changelog 658 | appname 659 | passwd 660 | requester_id 661 | service 662 | hours 663 | desc 664 | checkid 665 | rollbar_user 666 | event 667 | revision_id 668 | deployed_by 669 | deployed_to 670 | annotated_by 671 | level 672 | event_epoch 673 | host_names 674 | host_groups 675 | collect_data 676 | server_ip 677 | server_status 678 | server_ports 679 | service_group 680 | service_group_protocol 681 | service_group_method 682 | servers 683 | write_config 684 | virtual_server 685 | virtual_server_ip 686 | virtual_server_status 687 | virtual_server_ports 688 | nsc_host 689 | nsc_protocol 690 | account_email 691 | account_api_token 692 | record_ids 693 | solo 694 | account_key 695 | account_secret 696 | record_name 697 | record_type 698 | record_value 699 | record_ttl 700 | session 701 | include 702 | partition 703 | parent 704 | parent_partition 705 | send 706 | receive 707 | receive_disable 708 | interval 709 | time_until_up 710 | lb_method 711 | monitor_type 712 | quorum 713 | monitors 714 | slow_ramp_time 715 | service_down_action 716 | connection_limit 717 | rate_limit 718 | ratio 719 | bridge 720 | subscription 721 | room 722 | notify 723 | external_user_name 724 | from_address 725 | subject 726 | from_name 727 | reply_to 728 | project 729 | channel_token 730 | message 731 | icon_url 732 | from 733 | color 734 | msg_format 735 | api 736 | nick 737 | channel 738 | use_ssl 739 | to 740 | cc 741 | bcc 742 | attach 743 | headers 744 | charset 745 | topic 746 | payload 747 | qos 748 | retain 749 | api_secret 750 | voice 751 | icon_emoji 752 | link_names 753 | parse 754 | sqs 755 | sms 756 | http 757 | https 758 | account_sid 759 | auth_token 760 | to_number 761 | from_number 762 | client_secret 763 | working_dir 764 | prefer_source 765 | prefer_dist 766 | no_dev 767 | no_scripts 768 | no_plugins 769 | optimize_autoloader 770 | from_path 771 | notest 772 | locallib 773 | mirror 774 | global 775 | ignore_scripts 776 | production 777 | update_homebrew 778 | upgrade_all 779 | install_options 780 | tap 781 | list_url 782 | cached 783 | annotation 784 | pkgsite 785 | site 786 | package 787 | deep 788 | newuse 789 | changed_use 790 | oneshot 791 | noreplace 792 | nodeps 793 | onlydeps 794 | depclean 795 | quiet 796 | verbose 797 | sync 798 | use_packages 799 | proxy 800 | response_file 801 | category 802 | depot 803 | no-suggests 804 | disable_recommends 805 | oauthkey 806 | hookurl 807 | script_file 808 | units 809 | unique 810 | capability 811 | question 812 | vtype 813 | unseen 814 | dev 815 | rich_rule 816 | permanent 817 | split 818 | fail_key 819 | blacklist_file 820 | vg 821 | pvs 822 | pesize 823 | vg_options 824 | lv 825 | portal 826 | node_auth 827 | node_user 828 | node_pass 829 | auto_node_startup 830 | discover 831 | show_nodes 832 | direction 833 | logging 834 | insert 835 | rule 836 | log 837 | from_ip 838 | from_port 839 | to_ip 840 | to_port 841 | proto 842 | interface 843 | aclinherit 844 | aclmode 845 | atime 846 | canmount 847 | casesensitivity 848 | compression 849 | copies 850 | dedup 851 | devices 852 | exec 853 | jailed 854 | logbias 855 | mountpoint 856 | nbmand 857 | normalization 858 | primarycache 859 | quota 860 | readonly 861 | recordsize 862 | refquota 863 | refreservation 864 | reservation 865 | secondarycache 866 | setuid 867 | shareiscsi 868 | sharenfs 869 | sharesmb 870 | snapdir 871 | utf8only 872 | volsize 873 | volblocksize 874 | vscan 875 | xattr 876 | zoned 877 | deployment 878 | deploy_path 879 | operation 880 | summary 881 | issuetype 882 | issue 883 | status 884 | assignee 885 | fields 886 | -------------------------------------------------------------------------------- /lib/generate.rb: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | require 'yaml' 3 | require 'erb' 4 | 5 | option_keys = [] 6 | Dir::glob(__dir__ + "/ansible/lib/ansible/modules/**/*").each {|f| 7 | if File.directory? f 8 | FileUtils.mkdir_p(File.join(__dir__ + "/../snippets/text-mode/ansible", File.basename(f))) 9 | next 10 | end 11 | puts f 12 | yml = '' 13 | start = false 14 | open(f).each {|line| 15 | start = false if /^'''/.match line 16 | start = false if /^"""/.match line 17 | line.gsub!(/(.+)\- "When(.+)"$/, '\1- When\2') # for postgresql_user DOCUMENTATION 18 | yml << line if start 19 | start = true if /^DOCUMENTATION = .?'''/.match line 20 | start = true if /^DOCUMENTATION = .?"""/.match line 21 | } if File.file? f 22 | doc = YAML.load(yml) 23 | next unless doc 24 | index = 2 25 | options = '' 26 | doc['options'].each {|key, value| 27 | option_keys << key 28 | next unless value['required'] 29 | options << ' ' 30 | options << key 31 | if value['default'] 32 | options << '=${' 33 | options << index.to_s 34 | options << ':' 35 | options << value['default'].to_s 36 | options << '}' 37 | else 38 | options << '=$' 39 | options << index.to_s 40 | end 41 | index += 1 42 | } if doc['options'] 43 | options = ' $2' unless doc['options'] 44 | 45 | options << ' $0' 46 | template = < 48 | # key : <%= doc['module'] %> 49 | # condition: ansible 50 | # -- 51 | - name: ${1:<%= doc['short_description'] %>} 52 | <%= doc['module'] %>:<%= options %> 53 | EOS 54 | snippet = ERB.new template 55 | dirname = File.basename(File.dirname(f)) 56 | File.write(File.join(__dir__ + "/../snippets/text-mode/ansible", dirname, File.basename(f).gsub(/.py$/, '')), snippet.result(binding)) 57 | 58 | File.write(__dir__ + "/../dict/ansible", option_keys.uniq.join("\n")) 59 | } 60 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/a10/a10_server: -------------------------------------------------------------------------------- 1 | # name : Manage A10 Networks AX/SoftAX/Thunder/vThunder devices 2 | # key : a10_server 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage A10 Networks AX/SoftAX/Thunder/vThunder devices} 6 | a10_server: host=$2 username=$3 password=$4 server_name=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/a10/a10_service_group: -------------------------------------------------------------------------------- 1 | # name : Manage A10 Networks AX/SoftAX/Thunder/vThunder devices 2 | # key : a10_service_group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage A10 Networks AX/SoftAX/Thunder/vThunder devices} 6 | a10_service_group: host=$2 username=$3 password=$4 service_group=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/a10/a10_virtual_server: -------------------------------------------------------------------------------- 1 | # name : Manage A10 Networks AX/SoftAX/Thunder/vThunder devices 2 | # key : a10_virtual_server 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage A10 Networks AX/SoftAX/Thunder/vThunder devices} 6 | a10_virtual_server: host=$2 username=$3 password=$4 virtual_server=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/cloudformation: -------------------------------------------------------------------------------- 1 | # name : create a AWS CloudFormation stack 2 | # key : cloudformation 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create a AWS CloudFormation stack} 6 | cloudformation: stack_name=$2 state=$3 template=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2: -------------------------------------------------------------------------------- 1 | # name : create, terminate, start or stop an instance in ec2, return instanceid 2 | # key : ec2 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create, terminate, start or stop an instance in ec2, return instanceid} 6 | ec2: instance_type=$2 image=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_ami: -------------------------------------------------------------------------------- 1 | # name : create or destroy an image in ec2, return imageid 2 | # key : ec2_ami 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create or destroy an image in ec2, return imageid} 6 | ec2_ami: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_ami_search: -------------------------------------------------------------------------------- 1 | # name : Retrieve AWS AMI for a given operating system. 2 | # key : ec2_ami_search 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Retrieve AWS AMI for a given operating system.} 6 | ec2_ami_search: distro=$2 release=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_asg: -------------------------------------------------------------------------------- 1 | # name : Create or delete AWS Autoscaling Groups 2 | # key : ec2_asg 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create or delete AWS Autoscaling Groups} 6 | ec2_asg: state=$2 name=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_eip: -------------------------------------------------------------------------------- 1 | # name : associate an EC2 elastic IP with an instance. 2 | # key : ec2_eip 3 | # condition: ansible 4 | # -- 5 | - name: ${1:associate an EC2 elastic IP with an instance.} 6 | ec2_eip: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_elb: -------------------------------------------------------------------------------- 1 | # name : De-registers or registers instances from EC2 ELBs 2 | # key : ec2_elb 3 | # condition: ansible 4 | # -- 5 | - name: ${1:De-registers or registers instances from EC2 ELBs} 6 | ec2_elb: state=$2 instance_id=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_elb_lb: -------------------------------------------------------------------------------- 1 | # name : Creates or destroys Amazon ELB. 2 | # key : ec2_elb_lb 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Creates or destroys Amazon ELB.} 6 | ec2_elb_lb: state=$2 name=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_facts: -------------------------------------------------------------------------------- 1 | # name : Gathers facts about remote hosts within ec2 (aws) 2 | # key : ec2_facts 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Gathers facts about remote hosts within ec2 (aws)} 6 | ec2_facts: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_group: -------------------------------------------------------------------------------- 1 | # name : maintain an ec2 VPC security group. 2 | # key : ec2_group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:maintain an ec2 VPC security group.} 6 | ec2_group: name=$2 description=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_instance: -------------------------------------------------------------------------------- 1 | # name : create, terminate, start or stop an instance in ec2, return instanceid 2 | # key : ec2_instance 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create, terminate, start or stop an instance in ec2, return instanceid} 6 | ec2_instance: instance_type=$2 image_id=$3 region=$4 $0 -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_instance_info: -------------------------------------------------------------------------------- 1 | # name : Gather information about ec2 instances in AWS. 2 | # key : ec2_instance_info 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Gathers facts about remote hosts within ec2 (aws)} 6 | ec2_facts: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_key: -------------------------------------------------------------------------------- 1 | # name : maintain an ec2 key pair. 2 | # key : ec2_key 3 | # condition: ansible 4 | # -- 5 | - name: ${1:maintain an ec2 key pair.} 6 | ec2_key: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_lc: -------------------------------------------------------------------------------- 1 | # name : Create or delete AWS Autoscaling Launch Configurations 2 | # key : ec2_lc 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create or delete AWS Autoscaling Launch Configurations} 6 | ec2_lc: state=$2 name=$3 instance_type=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_metric_alarm: -------------------------------------------------------------------------------- 1 | # name : Create/update or delete AWS Cloudwatch 'metric alarms' 2 | # key : ec2_metric_alarm 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create/update or delete AWS Cloudwatch 'metric alarms'} 6 | ec2_metric_alarm: state=$2 name=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_scaling_policy: -------------------------------------------------------------------------------- 1 | # name : Create or delete AWS scaling policies for Autoscaling groups 2 | # key : ec2_scaling_policy 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create or delete AWS scaling policies for Autoscaling groups} 6 | ec2_scaling_policy: state=$2 name=$3 asg_name=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_snapshot: -------------------------------------------------------------------------------- 1 | # name : creates a snapshot from an existing volume 2 | # key : ec2_snapshot 3 | # condition: ansible 4 | # -- 5 | - name: ${1:creates a snapshot from an existing volume} 6 | ec2_snapshot: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_tag: -------------------------------------------------------------------------------- 1 | # name : create and remove tag(s) to ec2 resources. 2 | # key : ec2_tag 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create and remove tag(s) to ec2 resources.} 6 | ec2_tag: resource=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_vol: -------------------------------------------------------------------------------- 1 | # name : create and attach a volume, return volume id and device map 2 | # key : ec2_vol 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create and attach a volume, return volume id and device map} 6 | ec2_vol: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/ec2_vpc: -------------------------------------------------------------------------------- 1 | # name : configure AWS virtual private clouds 2 | # key : ec2_vpc 3 | # condition: ansible 4 | # -- 5 | - name: ${1:configure AWS virtual private clouds} 6 | ec2_vpc: cidr_block=$2 resource_tags=$3 state=${4:present} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/elasticache: -------------------------------------------------------------------------------- 1 | # name : Manage cache clusters in Amazon Elasticache. 2 | # key : elasticache 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage cache clusters in Amazon Elasticache.} 6 | elasticache: state=$2 name=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/rds: -------------------------------------------------------------------------------- 1 | # name : create, delete, or modify an Amazon rds instance 2 | # key : rds 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create, delete, or modify an Amazon rds instance} 6 | rds: command=$2 instance_name=$3 region=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/rds_param_group: -------------------------------------------------------------------------------- 1 | # name : manage RDS parameter groups 2 | # key : rds_param_group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:manage RDS parameter groups} 6 | rds_param_group: state=${2:present} name=$3 region=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/rds_subnet_group: -------------------------------------------------------------------------------- 1 | # name : manage RDS database subnet groups 2 | # key : rds_subnet_group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:manage RDS database subnet groups} 6 | rds_subnet_group: state=${2:present} name=$3 region=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/route53: -------------------------------------------------------------------------------- 1 | # name : add or delete entries in Amazons Route53 DNS service 2 | # key : route53 3 | # condition: ansible 4 | # -- 5 | - name: ${1:add or delete entries in Amazons Route53 DNS service} 6 | route53: command=$2 zone=$3 record=$4 type=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/amazon/s3: -------------------------------------------------------------------------------- 1 | # name : S3 module putting a file into S3. 2 | # key : s3 3 | # condition: ansible 4 | # -- 5 | - name: ${1:S3 module putting a file into S3.} 6 | s3: bucket=$2 mode=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/azure/azure: -------------------------------------------------------------------------------- 1 | # name : create or terminate a virtual machine in azure 2 | # key : azure 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create or terminate a virtual machine in azure} 6 | azure: name=$2 location=$3 storage_account=$4 image=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/basics/get_url: -------------------------------------------------------------------------------- 1 | # name : Downloads files from HTTP, HTTPS, or FTP to node 2 | # key : get_url 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Downloads files from HTTP, HTTPS, or FTP to node} 6 | get_url: url=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/basics/slurp: -------------------------------------------------------------------------------- 1 | # name : Slurps a file from remote nodes 2 | # key : slurp 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Slurps a file from remote nodes} 6 | slurp: src=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/basics/uri: -------------------------------------------------------------------------------- 1 | # name : Interacts with webservices 2 | # key : uri 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Interacts with webservices} 6 | uri: url=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/citrix/netscaler: -------------------------------------------------------------------------------- 1 | # name : Manages Citrix NetScaler entities 2 | # key : netscaler 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages Citrix NetScaler entities} 6 | netscaler: nsc_host=$2 user=$3 password=$4 name=${5:hostname} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/commands/command: -------------------------------------------------------------------------------- 1 | # name : Executes a command on a remote node 2 | # key : command 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Executes a command on a remote node} 6 | command: free_form=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/commands/raw: -------------------------------------------------------------------------------- 1 | # name : Executes a low-down and dirty SSH command 2 | # key : raw 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Executes a low-down and dirty SSH command} 6 | raw: free_form=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/commands/script: -------------------------------------------------------------------------------- 1 | # name : Runs a local script on a remote node after transferring it 2 | # key : script 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Runs a local script on a remote node after transferring it} 6 | script: free_form=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/commands/shell: -------------------------------------------------------------------------------- 1 | # name : Execute commands in nodes. 2 | # key : shell 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Execute commands in nodes.} 6 | shell: free_form=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/digital_ocean/digital_ocean: -------------------------------------------------------------------------------- 1 | # name : Create/delete a droplet/SSH_key in DigitalOcean 2 | # key : digital_ocean 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create/delete a droplet/SSH_key in DigitalOcean} 6 | digital_ocean: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/digital_ocean/digital_ocean_domain: -------------------------------------------------------------------------------- 1 | # name : Create/delete a DNS record in DigitalOcean 2 | # key : digital_ocean_domain 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create/delete a DNS record in DigitalOcean} 6 | digital_ocean_domain: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/digital_ocean/digital_ocean_sshkey: -------------------------------------------------------------------------------- 1 | # name : Create/delete an SSH key in DigitalOcean 2 | # key : digital_ocean_sshkey 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create/delete an SSH key in DigitalOcean} 6 | digital_ocean_sshkey: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/docker/_docker_image: -------------------------------------------------------------------------------- 1 | # name : manage docker images 2 | # key : docker_image 3 | # condition: ansible 4 | # -- 5 | - name: ${1:manage docker images} 6 | docker_image: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/docker/docker: -------------------------------------------------------------------------------- 1 | # name : manage docker containers 2 | # key : docker 3 | # condition: ansible 4 | # -- 5 | - name: ${1:manage docker containers} 6 | docker: image=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/f5/bigip_facts: -------------------------------------------------------------------------------- 1 | # name : Collect facts from F5 BIG-IP devices 2 | # key : bigip_facts 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Collect facts from F5 BIG-IP devices} 6 | bigip_facts: server=$2 user=$3 password=$4 include=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/f5/bigip_monitor_http: -------------------------------------------------------------------------------- 1 | # name : Manages F5 BIG-IP LTM http monitors 2 | # key : bigip_monitor_http 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages F5 BIG-IP LTM http monitors} 6 | bigip_monitor_http: server=$2 user=$3 password=$4 name=$5 send=${6:none} receive=${7:none} receive_disable=${8:none} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/f5/bigip_monitor_tcp: -------------------------------------------------------------------------------- 1 | # name : Manages F5 BIG-IP LTM tcp monitors 2 | # key : bigip_monitor_tcp 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages F5 BIG-IP LTM tcp monitors} 6 | bigip_monitor_tcp: server=$2 user=$3 password=$4 name=$5 send=${6:none} receive=${7:none} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/f5/bigip_node: -------------------------------------------------------------------------------- 1 | # name : Manages F5 BIG-IP LTM nodes 2 | # key : bigip_node 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages F5 BIG-IP LTM nodes} 6 | bigip_node: server=$2 user=$3 password=$4 state=${5:present} host=$6 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/f5/bigip_pool: -------------------------------------------------------------------------------- 1 | # name : Manages F5 BIG-IP LTM pools 2 | # key : bigip_pool 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages F5 BIG-IP LTM pools} 6 | bigip_pool: server=$2 user=$3 password=$4 name=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/f5/bigip_pool_member: -------------------------------------------------------------------------------- 1 | # name : Manages F5 BIG-IP LTM pool members 2 | # key : bigip_pool_member 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages F5 BIG-IP LTM pool members} 6 | bigip_pool_member: server=$2 user=$3 password=$4 state=${5:present} pool=$6 host=$7 port=$8 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/acl: -------------------------------------------------------------------------------- 1 | # name : Sets and retrieves file ACL information. 2 | # key : acl 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Sets and retrieves file ACL information.} 6 | acl: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/assemble: -------------------------------------------------------------------------------- 1 | # name : Assembles a configuration file from fragments 2 | # key : assemble 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Assembles a configuration file from fragments} 6 | assemble: src=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/copy: -------------------------------------------------------------------------------- 1 | # name : Copies files to remote locations. 2 | # key : copy 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Copies files to remote locations.} 6 | copy: dest=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/fetch: -------------------------------------------------------------------------------- 1 | # name : Fetches a file from remote nodes 2 | # key : fetch 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Fetches a file from remote nodes} 6 | fetch: src=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/file: -------------------------------------------------------------------------------- 1 | # name : Sets attributes of files 2 | # key : file 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Sets attributes of files} 6 | file: path=${2:[]} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/ini_file: -------------------------------------------------------------------------------- 1 | # name : Tweak settings in INI files 2 | # key : ini_file 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Tweak settings in INI files} 6 | ini_file: dest=$2 section=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/lineinfile: -------------------------------------------------------------------------------- 1 | # name : Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression. 2 | # key : lineinfile 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.} 6 | lineinfile: dest=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/replace: -------------------------------------------------------------------------------- 1 | # name : Replace all instances of a particular string in a file using a back-referenced regular expression. 2 | # key : replace 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Replace all instances of a particular string in a file using a back-referenced regular expression.} 6 | replace: dest=$2 regexp=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/stat: -------------------------------------------------------------------------------- 1 | # name : retrieve file or file system status 2 | # key : stat 3 | # condition: ansible 4 | # -- 5 | - name: ${1:retrieve file or file system status} 6 | stat: path=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/synchronize: -------------------------------------------------------------------------------- 1 | # name : Uses rsync to make synchronizing file paths in your playbooks quick and easy. 2 | # key : synchronize 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Uses rsync to make synchronizing file paths in your playbooks quick and easy.} 6 | synchronize: src=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/template: -------------------------------------------------------------------------------- 1 | # name : Templates a file out to a remote server. 2 | # key : template 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Templates a file out to a remote server.} 6 | template: src=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/unarchive: -------------------------------------------------------------------------------- 1 | # name : Copies an archive to a remote location and unpack it 2 | # key : unarchive 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Copies an archive to a remote location and unpack it} 6 | unarchive: src=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/files/xattr: -------------------------------------------------------------------------------- 1 | # name : set/retrieve extended attributes 2 | # key : xattr 3 | # condition: ansible 4 | # -- 5 | - name: ${1:set/retrieve extended attributes} 6 | xattr: name=${2:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/google/gc_storage: -------------------------------------------------------------------------------- 1 | # name : This module manages objects/buckets in Google Cloud Storage. 2 | # key : gc_storage 3 | # condition: ansible 4 | # -- 5 | - name: ${1:This module manages objects/buckets in Google Cloud Storage.} 6 | gc_storage: bucket=$2 mode=$3 gcs_secret_key=$4 gcs_access_key=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/google/gce: -------------------------------------------------------------------------------- 1 | # name : create or terminate GCE instances 2 | # key : gce 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create or terminate GCE instances} 6 | gce: zone=${2:us-central1-a} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/google/gce_lb: -------------------------------------------------------------------------------- 1 | # name : create/destroy GCE load-balancer resources 2 | # key : gce_lb 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create/destroy GCE load-balancer resources} 6 | gce_lb: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/google/gce_net: -------------------------------------------------------------------------------- 1 | # name : create/destroy GCE networks and firewall rules 2 | # key : gce_net 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create/destroy GCE networks and firewall rules} 6 | gce_net: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/google/gce_pd: -------------------------------------------------------------------------------- 1 | # name : utilize GCE persistent disk resources 2 | # key : gce_pd 3 | # condition: ansible 4 | # -- 5 | - name: ${1:utilize GCE persistent disk resources} 6 | gce_pd: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/helper/accelerate: -------------------------------------------------------------------------------- 1 | # name : Enable accelerated mode on remote node 2 | # key : accelerate 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Enable accelerated mode on remote node} 6 | accelerate: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/helper/fireball: -------------------------------------------------------------------------------- 1 | # name : Enable fireball mode on remote node 2 | # key : fireball 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Enable fireball mode on remote node} 6 | fireball: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/inventory/add_host: -------------------------------------------------------------------------------- 1 | # name : add a host (and alternatively a group) to the ansible-playbook in-memory inventory 2 | # key : add_host 3 | # condition: ansible 4 | # -- 5 | - name: ${1:add a host (and alternatively a group) to the ansible-playbook in-memory inventory} 6 | add_host: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/inventory/group_by: -------------------------------------------------------------------------------- 1 | # name : Create Ansible groups based on facts 2 | # key : group_by 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create Ansible groups based on facts} 6 | group_by: key=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/language/composer: -------------------------------------------------------------------------------- 1 | # name : Dependency Manager for PHP 2 | # key : composer 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Dependency Manager for PHP} 6 | composer: working_dir=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/language/cpanm: -------------------------------------------------------------------------------- 1 | # name : Manages Perl library dependencies. 2 | # key : cpanm 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages Perl library dependencies.} 6 | cpanm: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/language/easy_install: -------------------------------------------------------------------------------- 1 | # name : Installs Python libraries 2 | # key : easy_install 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Installs Python libraries} 6 | easy_install: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/language/gem: -------------------------------------------------------------------------------- 1 | # name : Manage Ruby gems 2 | # key : gem 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Ruby gems} 6 | gem: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/language/npm: -------------------------------------------------------------------------------- 1 | # name : Manage node.js packages with npm 2 | # key : npm 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage node.js packages with npm} 6 | npm: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/language/pip: -------------------------------------------------------------------------------- 1 | # name : Manages Python library dependencies. 2 | # key : pip 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages Python library dependencies.} 6 | pip: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/linode/linode: -------------------------------------------------------------------------------- 1 | # name : create / delete / stop / restart an instance in Linode Public Cloud 2 | # key : linode 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete / stop / restart an instance in Linode Public Cloud} 6 | linode: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/assert: -------------------------------------------------------------------------------- 1 | # name : Fail with custom message 2 | # key : assert 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Fail with custom message} 6 | assert: that=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/async_status: -------------------------------------------------------------------------------- 1 | # name : Obtain status of asynchronous task 2 | # key : async_status 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Obtain status of asynchronous task} 6 | async_status: jid=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/debug: -------------------------------------------------------------------------------- 1 | # name : Print statements during execution 2 | # key : debug 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Print statements during execution} 6 | debug: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/fail: -------------------------------------------------------------------------------- 1 | # name : Fail with custom message 2 | # key : fail 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Fail with custom message} 6 | fail: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/include_vars: -------------------------------------------------------------------------------- 1 | # name : Load variables from files, dynamically within a task. 2 | # key : include_vars 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Load variables from files, dynamically within a task.} 6 | include_vars: free-form=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/pause: -------------------------------------------------------------------------------- 1 | # name : Pause playbook execution 2 | # key : pause 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Pause playbook execution} 6 | pause: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/set_fact: -------------------------------------------------------------------------------- 1 | # name : Set host facts from a task 2 | # key : set_fact 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Set host facts from a task} 6 | set_fact: key_value=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/logic/wait_for: -------------------------------------------------------------------------------- 1 | # name : Waits for a condition before continuing. 2 | # key : wait_for 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Waits for a condition before continuing.} 6 | wait_for: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/messaging/rabbitmq_parameter: -------------------------------------------------------------------------------- 1 | # name : Adds or removes parameters to RabbitMQ 2 | # key : rabbitmq_parameter 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes parameters to RabbitMQ} 6 | rabbitmq_parameter: component=$2 name=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/messaging/rabbitmq_plugin: -------------------------------------------------------------------------------- 1 | # name : Adds or removes plugins to RabbitMQ 2 | # key : rabbitmq_plugin 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes plugins to RabbitMQ} 6 | rabbitmq_plugin: names=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/messaging/rabbitmq_policy: -------------------------------------------------------------------------------- 1 | # name : Manage the state of policies in RabbitMQ. 2 | # key : rabbitmq_policy 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage the state of policies in RabbitMQ.} 6 | rabbitmq_policy: name=$2 pattern=$3 tags=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/messaging/rabbitmq_user: -------------------------------------------------------------------------------- 1 | # name : Adds or removes users to RabbitMQ 2 | # key : rabbitmq_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes users to RabbitMQ} 6 | rabbitmq_user: user=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/messaging/rabbitmq_vhost: -------------------------------------------------------------------------------- 1 | # name : Manage the state of a virtual host in RabbitMQ 2 | # key : rabbitmq_vhost 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage the state of a virtual host in RabbitMQ} 6 | rabbitmq_vhost: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/misc/mongodb_user: -------------------------------------------------------------------------------- 1 | # name : Adds or removes a user from a MongoDB database. 2 | # key : mongodb_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes a user from a MongoDB database.} 6 | mongodb_user: database=$2 user=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/misc/ovirt: -------------------------------------------------------------------------------- 1 | # name : oVirt/RHEV platform management 2 | # key : ovirt 3 | # condition: ansible 4 | # -- 5 | - name: ${1:oVirt/RHEV platform management} 6 | ovirt: user=$2 url=$3 instance_name=$4 password=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/misc/redis: -------------------------------------------------------------------------------- 1 | # name : Various redis commands, slave and flush 2 | # key : redis 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Various redis commands, slave and flush} 6 | redis: command=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/misc/riak: -------------------------------------------------------------------------------- 1 | # name : This module handles some common Riak operations 2 | # key : riak 3 | # condition: ansible 4 | # -- 5 | - name: ${1:This module handles some common Riak operations} 6 | riak: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/misc/virt: -------------------------------------------------------------------------------- 1 | # name : Manages virtual machines supported by libvirt 2 | # key : virt 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages virtual machines supported by libvirt} 6 | virt: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/airbrake_deployment: -------------------------------------------------------------------------------- 1 | # name : Notify airbrake about app deployments 2 | # key : airbrake_deployment 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Notify airbrake about app deployments} 6 | airbrake_deployment: token=$2 environment=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/bigpanda: -------------------------------------------------------------------------------- 1 | # name : Notify BigPanda about deployments 2 | # key : bigpanda 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Notify BigPanda about deployments} 6 | bigpanda: component=$2 version=$3 token=$4 state=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/boundary_meter: -------------------------------------------------------------------------------- 1 | # name : Manage boundary meters 2 | # key : boundary_meter 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage boundary meters} 6 | boundary_meter: name=$2 apiid=$3 apikey=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/datadog_event: -------------------------------------------------------------------------------- 1 | # name : Posts events to DataDog service 2 | # key : datadog_event 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Posts events to DataDog service} 6 | datadog_event: api_key=$2 title=$3 text=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/librato_annotation: -------------------------------------------------------------------------------- 1 | # name : create an annotation in librato 2 | # key : librato_annotation 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create an annotation in librato} 6 | librato_annotation: user=$2 api_key=$3 title=$4 links=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/logentries: -------------------------------------------------------------------------------- 1 | # name : Module for tracking logs via logentries.com 2 | # key : logentries 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Module for tracking logs via logentries.com} 6 | logentries: path=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/monit: -------------------------------------------------------------------------------- 1 | # name : Manage the state of a program monitored via Monit 2 | # key : monit 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage the state of a program monitored via Monit} 6 | monit: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/nagios: -------------------------------------------------------------------------------- 1 | # name : Perform common tasks in Nagios related to downtime and notifications. 2 | # key : nagios 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Perform common tasks in Nagios related to downtime and notifications.} 6 | nagios: action=$2 services=$3 command=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/newrelic_deployment: -------------------------------------------------------------------------------- 1 | # name : Notify newrelic about app deployments 2 | # key : newrelic_deployment 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Notify newrelic about app deployments} 6 | newrelic_deployment: token=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/pagerduty: -------------------------------------------------------------------------------- 1 | # name : Create PagerDuty maintenance windows 2 | # key : pagerduty 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create PagerDuty maintenance windows} 6 | pagerduty: state=$2 name=$3 user=$4 passwd=$5 token=$6 requester_id=$7 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/pingdom: -------------------------------------------------------------------------------- 1 | # name : Pause/unpause Pingdom alerts 2 | # key : pingdom 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Pause/unpause Pingdom alerts} 6 | pingdom: state=$2 checkid=$3 uid=$4 passwd=$5 key=$6 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/rollbar_deployment: -------------------------------------------------------------------------------- 1 | # name : Notify Rollbar about app deployments 2 | # key : rollbar_deployment 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Notify Rollbar about app deployments} 6 | rollbar_deployment: token=$2 environment=$3 revision=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/stackdriver: -------------------------------------------------------------------------------- 1 | # name : Send code deploy and annotation events to stackdriver 2 | # key : stackdriver 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send code deploy and annotation events to stackdriver} 6 | stackdriver: key=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/monitoring/zabbix_maintenance: -------------------------------------------------------------------------------- 1 | # name : Create Zabbix maintenance windows 2 | # key : zabbix_maintenance 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create Zabbix maintenance windows} 6 | zabbix_maintenance: server_url=$2 login_user=$3 login_password=$4 name=$5 desc=${6:Created by Ansible} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/mysql/mysql_db: -------------------------------------------------------------------------------- 1 | # name : Add or remove MySQL databases from a remote host. 2 | # key : mysql_db 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add or remove MySQL databases from a remote host.} 6 | mysql_db: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/mysql/mysql_replication: -------------------------------------------------------------------------------- 1 | # name : Manage MySQL replication 2 | # key : mysql_replication 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage MySQL replication} 6 | mysql_replication: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/mysql/mysql_user: -------------------------------------------------------------------------------- 1 | # name : Adds or removes a user from a MySQL database. 2 | # key : mysql_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes a user from a MySQL database.} 6 | mysql_user: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/mysql/mysql_variables: -------------------------------------------------------------------------------- 1 | # name : Manage MySQL global variables 2 | # key : mysql_variables 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage MySQL global variables} 6 | mysql_variables: variable=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/network/dnsimple: -------------------------------------------------------------------------------- 1 | # name : Interface with dnsimple.com (a DNS hosting service). 2 | # key : dnsimple 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Interface with dnsimple.com (a DNS hosting service).} 6 | dnsimple: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/network/dnsmadeeasy: -------------------------------------------------------------------------------- 1 | # name : Interface with dnsmadeeasy.com (a DNS hosting service). 2 | # key : dnsmadeeasy 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Interface with dnsmadeeasy.com (a DNS hosting service).} 6 | dnsmadeeasy: account_key=$2 account_secret=$3 domain=$4 state=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/network/lldp: -------------------------------------------------------------------------------- 1 | # name : get details reported by lldp 2 | # key : lldp 3 | # condition: ansible 4 | # -- 5 | - name: ${1:get details reported by lldp} 6 | lldp: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/network/openvswitch_bridge: -------------------------------------------------------------------------------- 1 | # name : Manage Open vSwitch bridges 2 | # key : openvswitch_bridge 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Open vSwitch bridges} 6 | openvswitch_bridge: bridge=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/network/openvswitch_port: -------------------------------------------------------------------------------- 1 | # name : Manage Open vSwitch ports 2 | # key : openvswitch_port 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Open vSwitch ports} 6 | openvswitch_port: bridge=$2 port=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/campfire: -------------------------------------------------------------------------------- 1 | # name : Send a message to Campfire 2 | # key : campfire 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a message to Campfire} 6 | campfire: subscription=$2 token=$3 room=$4 msg=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/flowdock: -------------------------------------------------------------------------------- 1 | # name : Send a message to a flowdock 2 | # key : flowdock 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a message to a flowdock} 6 | flowdock: token=$2 type=$3 msg=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/grove: -------------------------------------------------------------------------------- 1 | # name : Sends a notification to a grove.io channel 2 | # key : grove 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Sends a notification to a grove.io channel} 6 | grove: channel_token=$2 message=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/hipchat: -------------------------------------------------------------------------------- 1 | # name : Send a message to hipchat 2 | # key : hipchat 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a message to hipchat} 6 | hipchat: token=$2 room=$3 msg=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/irc: -------------------------------------------------------------------------------- 1 | # name : Send a message to an IRC channel 2 | # key : irc 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a message to an IRC channel} 6 | irc: msg=$2 channel=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/jabber: -------------------------------------------------------------------------------- 1 | # name : Send a message to jabber user or chat room 2 | # key : jabber 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a message to jabber user or chat room} 6 | jabber: user=$2 password=$3 to=$4 msg=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/mail: -------------------------------------------------------------------------------- 1 | # name : Send an email 2 | # key : mail 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send an email} 6 | mail: subject=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/mqtt: -------------------------------------------------------------------------------- 1 | # name : Publish a message on an MQTT topic for the IoT 2 | # key : mqtt 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Publish a message on an MQTT topic for the IoT} 6 | mqtt: topic=$2 payload=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/nexmo: -------------------------------------------------------------------------------- 1 | # name : Send a SMS via nexmo 2 | # key : nexmo 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a SMS via nexmo} 6 | nexmo: api_key=$2 api_secret=$3 src=$4 dest=$5 msg=$6 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/osx_say: -------------------------------------------------------------------------------- 1 | # name : Makes an OSX computer to speak. 2 | # key : osx_say 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Makes an OSX computer to speak.} 6 | osx_say: msg=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/slack: -------------------------------------------------------------------------------- 1 | # name : Send Slack notifications 2 | # key : slack 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send Slack notifications} 6 | slack: domain=$2 token=$3 msg=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/sns: -------------------------------------------------------------------------------- 1 | # name : Send Amazon Simple Notification Service (SNS) messages 2 | # key : sns 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send Amazon Simple Notification Service (SNS) messages} 6 | sns: msg=$2 topic=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/twilio: -------------------------------------------------------------------------------- 1 | # name : Sends a text message to a mobile phone through Twilio. 2 | # key : twilio 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Sends a text message to a mobile phone through Twilio.} 6 | twilio: account_sid=$2 auth_token=$3 msg=$4 to_number=$5 from_number=$6 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/notification/typetalk: -------------------------------------------------------------------------------- 1 | # name : Send a message to typetalk 2 | # key : typetalk 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Send a message to typetalk} 6 | typetalk: client_id=$2 client_secret=$3 topic=$4 msg=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/glance_image: -------------------------------------------------------------------------------- 1 | # name : Add/Delete images from glance 2 | # key : glance_image 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add/Delete images from glance} 6 | glance_image: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} name=${5:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/keystone_user: -------------------------------------------------------------------------------- 1 | # name : Manage OpenStack Identity (keystone) users, tenants and roles 2 | # key : keystone_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage OpenStack Identity (keystone) users, tenants and roles} 6 | keystone_user: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/nova_compute: -------------------------------------------------------------------------------- 1 | # name : Create/Delete VMs from OpenStack 2 | # key : nova_compute 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create/Delete VMs from OpenStack} 6 | nova_compute: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} name=${5:None} image_id=${6:None} image_name=${7:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/nova_keypair: -------------------------------------------------------------------------------- 1 | # name : Add/Delete key pair from nova 2 | # key : nova_keypair 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add/Delete key pair from nova} 6 | nova_keypair: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} name=${5:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_floating_ip: -------------------------------------------------------------------------------- 1 | # name : Add/Remove floating IP from an instance 2 | # key : quantum_floating_ip 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add/Remove floating IP from an instance} 6 | quantum_floating_ip: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} network_name=${5:None} instance_name=${6:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_floating_ip_associate: -------------------------------------------------------------------------------- 1 | # name : Associate or disassociate a particular floating IP with an instance 2 | # key : quantum_floating_ip_associate 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Associate or disassociate a particular floating IP with an instance} 6 | quantum_floating_ip_associate: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:true} instance_name=${5:None} ip_address=${6:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_network: -------------------------------------------------------------------------------- 1 | # name : Creates/Removes networks from OpenStack 2 | # key : quantum_network 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Creates/Removes networks from OpenStack} 6 | quantum_network: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} name=${5:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_router: -------------------------------------------------------------------------------- 1 | # name : Create or Remove router from openstack 2 | # key : quantum_router 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create or Remove router from openstack} 6 | quantum_router: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} name=${5:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_router_gateway: -------------------------------------------------------------------------------- 1 | # name : set/unset a gateway interface for the router with the specified external network 2 | # key : quantum_router_gateway 3 | # condition: ansible 4 | # -- 5 | - name: ${1:set/unset a gateway interface for the router with the specified external network} 6 | quantum_router_gateway: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} router_name=${5:None} network_name=${6:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_router_interface: -------------------------------------------------------------------------------- 1 | # name : Attach/Dettach a subnet's interface to a router 2 | # key : quantum_router_interface 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Attach/Dettach a subnet's interface to a router} 6 | quantum_router_interface: login_username=${2:admin} login_password=${3:yes} login_tenant_name=${4:yes} router_name=${5:None} subnet_name=${6:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/openstack/quantum_subnet: -------------------------------------------------------------------------------- 1 | # name : Add/remove subnet from a network 2 | # key : quantum_subnet 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add/remove subnet from a network} 6 | quantum_subnet: login_username=${2:admin} login_password=${3:true} login_tenant_name=${4:true} network_name=${5:None} name=${6:None} cidr=${7:None} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/apt: -------------------------------------------------------------------------------- 1 | # name : Manages apt-packages 2 | # key : apt 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages apt-packages} 6 | apt: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/apt_key: -------------------------------------------------------------------------------- 1 | # name : Add or remove an apt key 2 | # key : apt_key 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add or remove an apt key} 6 | apt_key: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/apt_repository: -------------------------------------------------------------------------------- 1 | # name : Add and remove APT repositories 2 | # key : apt_repository 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add and remove APT repositories} 6 | apt_repository: repo=${2:none} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/apt_rpm: -------------------------------------------------------------------------------- 1 | # name : apt_rpm package manager 2 | # key : apt_rpm 3 | # condition: ansible 4 | # -- 5 | - name: ${1:apt_rpm package manager} 6 | apt_rpm: pkg=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/homebrew: -------------------------------------------------------------------------------- 1 | # name : Package manager for Homebrew 2 | # key : homebrew 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Package manager for Homebrew} 6 | homebrew: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/homebrew_cask: -------------------------------------------------------------------------------- 1 | # name : Install/uninstall homebrew casks. 2 | # key : homebrew_cask 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Install/uninstall homebrew casks.} 6 | homebrew_cask: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/homebrew_tap: -------------------------------------------------------------------------------- 1 | # name : Tap a Homebrew repository. 2 | # key : homebrew_tap 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Tap a Homebrew repository.} 6 | homebrew_tap: tap=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/layman: -------------------------------------------------------------------------------- 1 | # name : Manage Gentoo overlays 2 | # key : layman 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Gentoo overlays} 6 | layman: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/macports: -------------------------------------------------------------------------------- 1 | # name : Package manager for MacPorts 2 | # key : macports 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Package manager for MacPorts} 6 | macports: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/openbsd_pkg: -------------------------------------------------------------------------------- 1 | # name : Manage packages on OpenBSD. 2 | # key : openbsd_pkg 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage packages on OpenBSD.} 6 | openbsd_pkg: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/opkg: -------------------------------------------------------------------------------- 1 | # name : Package manager for OpenWrt 2 | # key : opkg 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Package manager for OpenWrt} 6 | opkg: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/pacman: -------------------------------------------------------------------------------- 1 | # name : Manage packages with I(pacman) 2 | # key : pacman 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage packages with I(pacman)} 6 | pacman: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/pkgin: -------------------------------------------------------------------------------- 1 | # name : Package manager for SmartOS 2 | # key : pkgin 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Package manager for SmartOS} 6 | pkgin: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/pkgng: -------------------------------------------------------------------------------- 1 | # name : Package manager for FreeBSD >= 9.0 2 | # key : pkgng 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Package manager for FreeBSD >= 9.0} 6 | pkgng: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/pkgutil: -------------------------------------------------------------------------------- 1 | # name : Manage CSW-Packages on Solaris 2 | # key : pkgutil 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage CSW-Packages on Solaris} 6 | pkgutil: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/portage: -------------------------------------------------------------------------------- 1 | # name : Package manager for Gentoo 2 | # key : portage 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Package manager for Gentoo} 6 | portage: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/portinstall: -------------------------------------------------------------------------------- 1 | # name : Installing packages from FreeBSD's ports system 2 | # key : portinstall 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Installing packages from FreeBSD's ports system} 6 | portinstall: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/redhat_subscription: -------------------------------------------------------------------------------- 1 | # name : Manage Red Hat Network registration and subscriptions using the C(subscription-manager) command 2 | # key : redhat_subscription 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Red Hat Network registration and subscriptions using the C(subscription-manager) command} 6 | redhat_subscription: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/rhn_channel: -------------------------------------------------------------------------------- 1 | # name : Adds or removes Red Hat software channels 2 | # key : rhn_channel 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes Red Hat software channels} 6 | rhn_channel: name=$2 sysname=$3 url=$4 user=$5 password=$6 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/rhn_register: -------------------------------------------------------------------------------- 1 | # name : Manage Red Hat Network registration using the C(rhnreg_ks) command 2 | # key : rhn_register 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Red Hat Network registration using the C(rhnreg_ks) command} 6 | rhn_register: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/rpm_key: -------------------------------------------------------------------------------- 1 | # name : Adds or removes a gpg key from the rpm db 2 | # key : rpm_key 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes a gpg key from the rpm db} 6 | rpm_key: key=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/svr4pkg: -------------------------------------------------------------------------------- 1 | # name : Manage Solaris SVR4 packages 2 | # key : svr4pkg 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Solaris SVR4 packages} 6 | svr4pkg: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/swdepot: -------------------------------------------------------------------------------- 1 | # name : Manage packages with swdepot package manager (HP-UX) 2 | # key : swdepot 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage packages with swdepot package manager (HP-UX)} 6 | swdepot: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/urpmi: -------------------------------------------------------------------------------- 1 | # name : Urpmi manager 2 | # key : urpmi 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Urpmi manager} 6 | urpmi: pkg=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/yum: -------------------------------------------------------------------------------- 1 | # name : Manages packages with the I(yum) package manager 2 | # key : yum 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages packages with the I(yum) package manager} 6 | yum: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/zypper: -------------------------------------------------------------------------------- 1 | # name : Manage packages on SUSE and openSUSE 2 | # key : zypper 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage packages on SUSE and openSUSE} 6 | zypper: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/os/zypper_repository: -------------------------------------------------------------------------------- 1 | # name : Add and remove Zypper repositories 2 | # key : zypper_repository 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add and remove Zypper repositories} 6 | zypper_repository: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/postgresql/postgresql_db: -------------------------------------------------------------------------------- 1 | # name : Add or remove PostgreSQL databases from a remote host. 2 | # key : postgresql_db 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add or remove PostgreSQL databases from a remote host.} 6 | postgresql_db: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/postgresql/postgresql_privs: -------------------------------------------------------------------------------- 1 | # name : Grant or revoke privileges on PostgreSQL database objects. 2 | # key : postgresql_privs 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Grant or revoke privileges on PostgreSQL database objects.} 6 | postgresql_privs: database=$2 roles=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/postgresql/postgresql_user: -------------------------------------------------------------------------------- 1 | # name : Adds or removes a users (roles) from a PostgreSQL database. 2 | # key : postgresql_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes a users (roles) from a PostgreSQL database.} 6 | postgresql_user: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax: -------------------------------------------------------------------------------- 1 | # name : create / delete an instance in Rackspace Public Cloud 2 | # key : rax 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete an instance in Rackspace Public Cloud} 6 | rax: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_cbs: -------------------------------------------------------------------------------- 1 | # name : Manipulate Rackspace Cloud Block Storage Volumes 2 | # key : rax_cbs 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manipulate Rackspace Cloud Block Storage Volumes} 6 | rax_cbs: name=$2 size=${3:100} state=${4:present} volume_type=${5:SATA} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_cbs_attachments: -------------------------------------------------------------------------------- 1 | # name : Manipulate Rackspace Cloud Block Storage Volume Attachments 2 | # key : rax_cbs_attachments 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manipulate Rackspace Cloud Block Storage Volume Attachments} 6 | rax_cbs_attachments: device=$2 volume=$3 server=$4 state=${5:present} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_cdb: -------------------------------------------------------------------------------- 1 | # name : create/delete or resize a Rackspace Cloud Databases instance 2 | # key : rax_cdb 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create/delete or resize a Rackspace Cloud Databases instance} 6 | rax_cdb: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_cdb_database: -------------------------------------------------------------------------------- 1 | # name : create / delete a database in the Cloud Databases 2 | # key : rax_cdb_database 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete a database in the Cloud Databases} 6 | rax_cdb_database: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_cdb_user: -------------------------------------------------------------------------------- 1 | # name : create / delete a Rackspace Cloud Database 2 | # key : rax_cdb_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete a Rackspace Cloud Database} 6 | rax_cdb_user: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_clb: -------------------------------------------------------------------------------- 1 | # name : create / delete a load balancer in Rackspace Public Cloud 2 | # key : rax_clb 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete a load balancer in Rackspace Public Cloud} 6 | rax_clb: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_clb_nodes: -------------------------------------------------------------------------------- 1 | # name : add, modify and remove nodes from a Rackspace Cloud Load Balancer 2 | # key : rax_clb_nodes 3 | # condition: ansible 4 | # -- 5 | - name: ${1:add, modify and remove nodes from a Rackspace Cloud Load Balancer} 6 | rax_clb_nodes: load_balancer_id=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_dns: -------------------------------------------------------------------------------- 1 | # name : Manage domains on Rackspace Cloud DNS 2 | # key : rax_dns 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage domains on Rackspace Cloud DNS} 6 | rax_dns: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_dns_record: -------------------------------------------------------------------------------- 1 | # name : Manage DNS records on Rackspace Cloud DNS 2 | # key : rax_dns_record 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage DNS records on Rackspace Cloud DNS} 6 | rax_dns_record: data=$2 name=$3 type=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_facts: -------------------------------------------------------------------------------- 1 | # name : Gather facts for Rackspace Cloud Servers 2 | # key : rax_facts 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Gather facts for Rackspace Cloud Servers} 6 | rax_facts: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_files: -------------------------------------------------------------------------------- 1 | # name : Manipulate Rackspace Cloud Files Containers 2 | # key : rax_files 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manipulate Rackspace Cloud Files Containers} 6 | rax_files: container=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_files_objects: -------------------------------------------------------------------------------- 1 | # name : Upload, download, and delete objects in Rackspace Cloud Files 2 | # key : rax_files_objects 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Upload, download, and delete objects in Rackspace Cloud Files} 6 | rax_files_objects: container=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_identity: -------------------------------------------------------------------------------- 1 | # name : Load Rackspace Cloud Identity 2 | # key : rax_identity 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Load Rackspace Cloud Identity} 6 | rax_identity: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_keypair: -------------------------------------------------------------------------------- 1 | # name : Create a keypair for use with Rackspace Cloud Servers 2 | # key : rax_keypair 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create a keypair for use with Rackspace Cloud Servers} 6 | rax_keypair: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_meta: -------------------------------------------------------------------------------- 1 | # name : Manipulate metadata for Rackspace Cloud Servers 2 | # key : rax_meta 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manipulate metadata for Rackspace Cloud Servers} 6 | rax_meta: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_network: -------------------------------------------------------------------------------- 1 | # name : create / delete an isolated network in Rackspace Public Cloud 2 | # key : rax_network 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete an isolated network in Rackspace Public Cloud} 6 | rax_network: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_queue: -------------------------------------------------------------------------------- 1 | # name : create / delete a queue in Rackspace Public Cloud 2 | # key : rax_queue 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create / delete a queue in Rackspace Public Cloud} 6 | rax_queue: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_scaling_group: -------------------------------------------------------------------------------- 1 | # name : Manipulate Rackspace Cloud Autoscale Groups 2 | # key : rax_scaling_group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manipulate Rackspace Cloud Autoscale Groups} 6 | rax_scaling_group: flavor=$2 image=$3 max_entities=$4 min_entities=$5 name=$6 server_name=$7 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/rackspace/rax_scaling_policy: -------------------------------------------------------------------------------- 1 | # name : Manipulate Rackspace Cloud Autoscale Scaling Policy 2 | # key : rax_scaling_policy 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manipulate Rackspace Cloud Autoscale Scaling Policy} 6 | rax_scaling_policy: name=$2 policy_type=$3 scaling_group=$4 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/source_control/bzr: -------------------------------------------------------------------------------- 1 | # name : Deploy software (or files) from bzr branches 2 | # key : bzr 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Deploy software (or files) from bzr branches} 6 | bzr: name=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/source_control/git: -------------------------------------------------------------------------------- 1 | # name : Deploy software (or files) from git checkouts 2 | # key : git 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Deploy software (or files) from git checkouts} 6 | git: repo=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/source_control/github_hooks: -------------------------------------------------------------------------------- 1 | # name : Manages github service hooks. 2 | # key : github_hooks 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages github service hooks.} 6 | github_hooks: user=$2 oauthkey=$3 repo=$4 action=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/source_control/hg: -------------------------------------------------------------------------------- 1 | # name : Manages Mercurial (hg) repositories. 2 | # key : hg 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages Mercurial (hg) repositories.} 6 | hg: repo=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/source_control/subversion: -------------------------------------------------------------------------------- 1 | # name : Deploys a subversion repository. 2 | # key : subversion 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Deploys a subversion repository.} 6 | subversion: repo=$2 dest=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/alternatives: -------------------------------------------------------------------------------- 1 | # name : Manages alternative programs for common commands 2 | # key : alternatives 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages alternative programs for common commands} 6 | alternatives: name=$2 path=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/at: -------------------------------------------------------------------------------- 1 | # name : Schedule the execution of a command or script file via the at command. 2 | # key : at 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Schedule the execution of a command or script file via the at command.} 6 | at: count=$2 units=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/authorized_key: -------------------------------------------------------------------------------- 1 | # name : Adds or removes an SSH authorized key 2 | # key : authorized_key 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Adds or removes an SSH authorized key} 6 | authorized_key: user=$2 key=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/capabilities: -------------------------------------------------------------------------------- 1 | # name : Manage Linux capabilities 2 | # key : capabilities 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage Linux capabilities} 6 | capabilities: path=$2 capability=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/cron: -------------------------------------------------------------------------------- 1 | # name : Manage cron.d and crontab entries. 2 | # key : cron 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage cron.d and crontab entries.} 6 | cron: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/debconf: -------------------------------------------------------------------------------- 1 | # name : Configure a .deb package 2 | # key : debconf 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Configure a .deb package} 6 | debconf: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/facter: -------------------------------------------------------------------------------- 1 | # name : Runs the discovery program I(facter) on the remote system 2 | # key : facter 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Runs the discovery program I(facter) on the remote system} 6 | facter: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/filesystem: -------------------------------------------------------------------------------- 1 | # name : Makes file system on block device 2 | # key : filesystem 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Makes file system on block device} 6 | filesystem: fstype=$2 dev=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/firewalld: -------------------------------------------------------------------------------- 1 | # name : Manage arbitrary ports/services with firewalld 2 | # key : firewalld 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage arbitrary ports/services with firewalld} 6 | firewalld: permanent=${2:true} state=${3:enabled} $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/getent: -------------------------------------------------------------------------------- 1 | # name : a wrapper to the unix getent utility 2 | # key : getent 3 | # condition: ansible 4 | # -- 5 | - name: ${1:a wrapper to the unix getent utility} 6 | getent: database=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/group: -------------------------------------------------------------------------------- 1 | # name : Add or remove groups 2 | # key : group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add or remove groups} 6 | group: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/hostname: -------------------------------------------------------------------------------- 1 | # name : Manage hostname 2 | # key : hostname 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage hostname} 6 | hostname: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/kernel_blacklist: -------------------------------------------------------------------------------- 1 | # name : Blacklist kernel modules 2 | # key : kernel_blacklist 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Blacklist kernel modules} 6 | kernel_blacklist: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/locale_gen: -------------------------------------------------------------------------------- 1 | # name : Creates or removes locales. 2 | # key : locale_gen 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Creates or removes locales.} 6 | locale_gen: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/lvg: -------------------------------------------------------------------------------- 1 | # name : Configure LVM volume groups 2 | # key : lvg 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Configure LVM volume groups} 6 | lvg: vg=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/lvol: -------------------------------------------------------------------------------- 1 | # name : Configure LVM logical volumes 2 | # key : lvol 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Configure LVM logical volumes} 6 | lvol: vg=$2 lv=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/modprobe: -------------------------------------------------------------------------------- 1 | # name : Add or remove kernel modules 2 | # key : modprobe 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add or remove kernel modules} 6 | modprobe: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/mount: -------------------------------------------------------------------------------- 1 | # name : Control active and configured mount points 2 | # key : mount 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Control active and configured mount points} 6 | mount: name=$2 src=$3 fstype=$4 state=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/ohai: -------------------------------------------------------------------------------- 1 | # name : Returns inventory data from I(Ohai) 2 | # key : ohai 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Returns inventory data from I(Ohai)} 6 | ohai: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/open_iscsi: -------------------------------------------------------------------------------- 1 | # name : Manage iscsi targets with open-iscsi 2 | # key : open_iscsi 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage iscsi targets with open-iscsi} 6 | open_iscsi: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/ping: -------------------------------------------------------------------------------- 1 | # name : Try to connect to host and return C(pong) on success. 2 | # key : ping 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Try to connect to host and return C(pong) on success.} 6 | ping: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/seboolean: -------------------------------------------------------------------------------- 1 | # name : Toggles SELinux booleans. 2 | # key : seboolean 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Toggles SELinux booleans.} 6 | seboolean: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/selinux: -------------------------------------------------------------------------------- 1 | # name : Change policy and state of SELinux 2 | # key : selinux 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Change policy and state of SELinux} 6 | selinux: state=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/service: -------------------------------------------------------------------------------- 1 | # name : Manage services. 2 | # key : service 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage services.} 6 | service: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/setup: -------------------------------------------------------------------------------- 1 | # name : Gathers facts about remote hosts 2 | # key : setup 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Gathers facts about remote hosts} 6 | setup: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/sysctl: -------------------------------------------------------------------------------- 1 | # name : Manage entries in sysctl.conf. 2 | # key : sysctl 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage entries in sysctl.conf.} 6 | sysctl: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/ufw: -------------------------------------------------------------------------------- 1 | # name : Manage firewall with UFW 2 | # key : ufw 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage firewall with UFW} 6 | ufw: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/user: -------------------------------------------------------------------------------- 1 | # name : Manage user accounts 2 | # key : user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage user accounts} 6 | user: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/system/zfs: -------------------------------------------------------------------------------- 1 | # name : Manage zfs 2 | # key : zfs 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage zfs} 6 | zfs: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/vmware/vsphere_guest: -------------------------------------------------------------------------------- 1 | # name : Create/delete/manage a guest VM through VMware vSphere. 2 | # key : vsphere_guest 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Create/delete/manage a guest VM through VMware vSphere.} 6 | vsphere_guest: vcenter_hostname=$2 guest=$3 username=$4 password=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/apache2_module: -------------------------------------------------------------------------------- 1 | # name : enables/disables a module of the Apache2 webserver 2 | # key : apache2_module 3 | # condition: ansible 4 | # -- 5 | - name: ${1:enables/disables a module of the Apache2 webserver} 6 | apache2_module: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/django_manage: -------------------------------------------------------------------------------- 1 | # name : Manages a Django application. 2 | # key : django_manage 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages a Django application.} 6 | django_manage: command=$2 app_path=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/ejabberd_user: -------------------------------------------------------------------------------- 1 | # name : Manages users for ejabberd servers 2 | # key : ejabberd_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages users for ejabberd servers} 6 | ejabberd_user: username=$2 host=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/htpasswd: -------------------------------------------------------------------------------- 1 | # name : manage user files for basic authentication 2 | # key : htpasswd 3 | # condition: ansible 4 | # -- 5 | - name: ${1:manage user files for basic authentication} 6 | htpasswd: path=$2 name=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/jboss: -------------------------------------------------------------------------------- 1 | # name : deploy applications to JBoss 2 | # key : jboss 3 | # condition: ansible 4 | # -- 5 | - name: ${1:deploy applications to JBoss} 6 | jboss: deployment=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/jira: -------------------------------------------------------------------------------- 1 | # name : create and modify issues in a JIRA instance 2 | # key : jira 3 | # condition: ansible 4 | # -- 5 | - name: ${1:create and modify issues in a JIRA instance} 6 | jira: uri=$2 operation=$3 username=$4 password=$5 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/web_infrastructure/supervisorctl: -------------------------------------------------------------------------------- 1 | # name : Manage the state of a program or group of programs running via supervisord 2 | # key : supervisorctl 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manage the state of a program or group of programs running via supervisord} 6 | supervisorctl: name=$2 state=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_feature: -------------------------------------------------------------------------------- 1 | # name : Installs and uninstalls Windows Features 2 | # key : win_feature 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Installs and uninstalls Windows Features} 6 | win_feature: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_get_url: -------------------------------------------------------------------------------- 1 | # name : Fetches a file from a given URL 2 | # key : win_get_url 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Fetches a file from a given URL} 6 | win_get_url: url=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_group: -------------------------------------------------------------------------------- 1 | # name : Add and remove local groups 2 | # key : win_group 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Add and remove local groups} 6 | win_group: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_msi: -------------------------------------------------------------------------------- 1 | # name : Installs and uninstalls Windows MSI files 2 | # key : win_msi 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Installs and uninstalls Windows MSI files} 6 | win_msi: path=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_ping: -------------------------------------------------------------------------------- 1 | # name : A windows version of the classic ping module. 2 | # key : win_ping 3 | # condition: ansible 4 | # -- 5 | - name: ${1:A windows version of the classic ping module.} 6 | win_ping: $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_service: -------------------------------------------------------------------------------- 1 | # name : Manages Windows services 2 | # key : win_service 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages Windows services} 6 | win_service: name=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_stat: -------------------------------------------------------------------------------- 1 | # name : returns information about a Windows file 2 | # key : win_stat 3 | # condition: ansible 4 | # -- 5 | - name: ${1:returns information about a Windows file} 6 | win_stat: path=$2 $0 7 | -------------------------------------------------------------------------------- /snippets/text-mode/ansible/windows/win_user: -------------------------------------------------------------------------------- 1 | # name : Manages local Windows user accounts 2 | # key : win_user 3 | # condition: ansible 4 | # -- 5 | - name: ${1:Manages local Windows user accounts} 6 | win_user: name=$2 password=$3 $0 7 | -------------------------------------------------------------------------------- /snippets/yaml-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode --------------------------------------------------------------------------------