• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
  • License
    BSD 2-Clause "Sim...
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Examples of Ansible.

Ansible examples

Various examples of Ansible code.

(This file is generated. Do not update it manually. See the section below.)

Index

Ansible filter

  • ansible.netcommon.ipaddr 254,
  • ansible.utils.hwaddr 197,
  • ansible.utils.keep_keys 289,
  • ansible.utils.remove_keys 289,
  • ansible.utils.replace_keys 289,
  • cartesian 156,
  • combine 111,
  • community.general.dict_kv 281,
  • community.general.groupby_as_dict 282,
  • community.general.jc 284,
  • community.general.lists_mergeby 286,
  • community.general.path_join 285,
  • community.general.version_sort 283,
  • d() 245,
  • default 245, 257,
  • default() 245,
  • default(omit) 257,
  • dict2items 103,
  • difference 98,
  • extract 174,
  • flatten 119,
  • from_yaml 26, 173,
  • from_yaml_all 173,
  • hwaddr 197,
  • intersect 159,
  • ipaddr 254,
  • json_query 2, 20, 43, 69, 267,
  • json_query filter contains 43, 69,
  • json_query function merge 290,
  • json_query functions 140,
  • json_query issue to_yaml|from_yaml 267,
  • password_hash 76,
  • product 156,
  • quote 183,
  • regex_replace 135,
  • shuffle 202,
  • splitext 192,
  • strftime 217,
  • ternary 180,
  • to_datetime 217,
  • to_nice_json 26,
  • to_yaml 173,
  • union 112,
  • zip 56,

Ansible keyword

Ansible plugins

  • Connection 218,

Ansible test

Basics

  • Asynchronous actions and polling 87,
  • Boolean 151,
  • Callback 150,
  • Compare dictionaries 253,
  • Expansion of expressions 149,
  • Expansion of variables 139,
  • Fibonacci 70,
  • Filters 32,
  • Handlers 93,
  • Inventory 80,
  • Jinja2 204,
  • Lazy evaluation 131,
  • Loop 176,
  • MySQL command 61,
  • NFS 227,
  • Passwords 34,
  • Python 248,
  • Quotation 101,
  • Role meta platforms 225,
  • Roles 141, 178,
  • Strings and Lists 38,
  • Test include_role, import_role, and tags 124,
  • Testing paths 185,
  • Vault 53,
  • Workflow 133,
  • Xen 44,
  • ZFS 42,
  • always 52,
  • async 87,
  • block 52,
  • falsy 272,
  • lookup plugins 39,
  • requirements.yml 232,
  • rescue 52,
  • run_once 46,
  • truthy 272,
  • vars 136, 178,

Boolean

  • and, or, xor 67,

Cache

  • cache plugin 181,
  • fact_caching = jsonfile 57,
  • jsonfile cache plugin 181,

Callback

  • community.general.log_plays 250,
  • log_plays 250,

Collection

  • F5 modules 81,
  • gcp 144,

Conditions

  • when 96,

Config

  • ANSIBLE_ACTION_WARNINGS 115,
  • ANSIBLE_CACHE_PLUGIN 261,
  • ANSIBLE_COLOR_* 208,
  • ANSIBLE_HASH_BEHAVIOUR 143,
  • ANSIBLE_KEEP_REMOTE_FILES 222,
  • ANSIBLE_PYTHON_INTERPRETER 155,
  • ANSIBLE_REMOTE_TMP, ANSIBLE_REMOTE_TEMP 223,
  • ANSIBLE_REMOTE_USER 205,
  • CONDITIONAL_BARE_VARS 182,
  • DEFAULT_JINJA2_NATIVE 260,
  • action_warnings 115,
  • ansible_python_interpreter 155,
  • ansible_remote_tmp 223,
  • colors section 208,
  • conditional_bare_variables 182,
  • filter_plugins 85,
  • hash_behaviour 143,
  • remote_tmp 223,
  • remote_user 205,

Custom filter

  • combine_lossless 262,
  • dict_flatten 138,
  • dict_utils 138,
  • mac-vendor-lookup 292,
  • netaddr_iter_iprange 254,

Custom module

  • Python subprocess.run 163,

Data structure

Delegation

  • delegate_facts 186,
  • local_action 83,

Deprecated

  • warning 29,

Devel

  • Custom modules 256,
  • Development of a module 279,
  • Job management (async, async_status, kill, logger, cache) 287,
  • Role UBUNTU20-CIS 293,
  • Supports_check_mode and changed 279,
  • filter_core 291,
  • vbotka.ansible.community.general filter any2items 237,

Dictionary

  • Create, update, combine 207,
  • Iterate dictionary in play 3,
  • Iterate dictionary in template 1,
  • Select items from dictionary 12,

Handlers

Import

  • import_playbook 15,

Include

  • Galaxy role vbotka.ansible_lib 65, 66,
  • include_role 18, 24, 65,
  • include_vars 24, 66,

Indentation

  • Test indentation of a block 13,

Inventory

  • Dynamic inventory 125,
  • hosts 86,

Jinja

  • Jinja template formatting 236,
  • Jinja tests 265,
  • loop.index 295,
  • lstrip_blocks 100,
  • trim_blocks 100,
  • white-space control 100,

Jinja filter

Jinja function

Jinja template

  • ansible_managed 278,
  • extends 194,
  • if then else 191,
  • set 73,
  • template 75,

List

  • Add item to list 99,
  • Managing lists 247,

Lookup

  • ansible.builtin.indexed_items 170,
  • ansible.utils.to_paths 280,
  • community.general.dig 169,
  • dig 169,
  • env 116,
  • file 210,
  • fileglob 106,
  • first_found 120,
  • inventory_hostnames 271,
  • password 145,
  • pipe 184,
  • subelements 40,
  • to_paths 280,
  • with_indexed_items 170,

Loop

  • Extended loop variables 220,
  • Iterate blockinfile from templates 45,
  • Nested loops 54,
  • extended 220,
  • include_tasks 241,
  • index_var 6,
  • loop include_tasks 8,
  • loop include_tasks and delegate_to 14,
  • loop_control 6, 220,
  • run_once 241,
  • with_items vs. loop 243,
  • with_lines 95,
  • with_sequence 6,
  • with_together zip 63,

Math

  • Arithmetic 55,
  • Jinja math 10,
  • compare integers 263,

Module

  • add_host 134,
  • ansible.builtin.add_host 134,
  • ansible.builtin.assert 239,
  • ansible.builtin.async_status 5,
  • ansible.builtin.blockinfile 123,
  • ansible.builtin.command 30, 35, 171,
  • ansible.builtin.copy 94,
  • ansible.builtin.cron 231,
  • ansible.builtin.debug 168,
  • ansible.builtin.expect 72,
  • ansible.builtin.fail 90,
  • ansible.builtin.fetch 203,
  • ansible.builtin.file 130,
  • ansible.builtin.find 37,
  • ansible.builtin.getent 48,
  • ansible.builtin.group_by 108,
  • ansible.builtin.include_tasks 190,
  • ansible.builtin.include_vars 142,
  • ansible.builtin.lineinfile 84,
  • ansible.builtin.meta 154,
  • ansible.builtin.package 198,
  • ansible.builtin.package_facts 121,
  • ansible.builtin.ping 226,
  • ansible.builtin.raw 137,
  • ansible.builtin.replace 77,
  • ansible.builtin.script 128,
  • ansible.builtin.set_fact 22, 167,
  • ansible.builtin.set_stats 58,
  • ansible.builtin.setup 212,
  • ansible.builtin.shell 128, 172,
  • ansible.builtin.slurp 235,
  • ansible.builtin.stat 127,
  • ansible.builtin.tempfile 189,
  • ansible.builtin.unarchive 78,
  • ansible.builtin.uri 51,
  • ansible.builtin.user 11,
  • ansible.builtin.wait_for 110,
  • ansible.builtin.wait_for_connection 209,
  • ansible.builtin.yum 107,
  • ansible.netcommon.net_ping 226,
  • ansible.posix.synchronize 7,
  • ansible.posix.sysctl 238,
  • assert 239,
  • async_status 5,
  • blockinfile 123,
  • cisco.ios.ios_ping 226,
  • cli_parse 274,
  • command 30, 35, 171, 172,
  • community.crypto.openssl_* 228,
  • community.crypto.x509_certificate 242,
  • community.general.cronvar 231,
  • community.general.dconf 92,
  • community.general.ini_file 102,
  • community.general.mail 193,
  • community.general.parted 25,
  • community.general.read_csv 153,
  • community.general.snmp_facts 152,
  • community.general.xml 199,
  • copy 94,
  • creates 35,
  • cron 231,
  • csv 153,
  • dconf 92,
  • debug 168,
  • expect 72,
  • fail 90,
  • fetch 203,
  • file 130,
  • find 37,
  • flush_handlers 288,
  • get_url 273,
  • getent 48,
  • group_by 108,
  • import_role 124,
  • include_role 124,
  • include_tasks 190,
  • include_vars 142,
  • ini_file 102,
  • ios_ping 226,
  • lineinfile 84, 277,
  • mail 193,
  • meta 154, 288,
  • net_ping 226,
  • openssl_* 228,
  • package 198,
  • package_facts 121,
  • ping 226,
  • raw 137,
  • read_csv 153,
  • replace 77,
  • script 128,
  • set_fact 22, 167,
  • set_stats 58,
  • setup 212,
  • shell 128, 172,
  • slurp 235,
  • snmp_facts 152,
  • stat 127,
  • synchronize 7,
  • sysctl 238,
  • tempfile 189,
  • unarchive 78,
  • uri 51,
  • user 11,
  • wait_for 110,
  • wait_for_connection 209,
  • xml 199,
  • yum 107,

Parameter

  • check ansible-playbook parameter, ansible_check_mode 213,
  • limit 132,
  • validate 164,

Playbook

  • Run the playbook only on one host per group 47,

Python method

Recursion

  • Referencing other dict keys in the same parent dict is not supported 129,

Role

  • CIS role UBUNTU20-CIS 293,
  • Galaxy role vbotka.ansible_lib 270,
  • Galaxy role vbotka.config_light 148,
  • Role defaults 266,
  • al_bsd_service_facts 270,

Setup

  • ansible.builtin.setup 9,
  • ansible_interfaces 252,
  • ansible_mounts 249,
  • gather_facts 9,
  • service_facts 9,

Special variables

  • ansible_play_batch 255,
  • ansible_play_hosts 255,
  • ansible_play_hosts_all 255,
  • group_names 175,
  • groups 113,

Strategy plugin

  • host_pinned 221,

String

  • Concatenate strings 246,
  • match 79,
  • regex 79,
  • search 79,
  • string manipulation 200,
  • testing strings 79,

Syntax

  • Python null 224,
  • YAML None 224,

Tags

  • block tags 264,
  • import_playbook and tags 19,
  • variable in tags 269,

Test

  • Galaxy role vbotka.linux_lib 91,
  • boolean 294,
  • bulk-set task arguments 89,
  • items2dict2 114,
  • iterable 294,
  • mapping 294,
  • race conditions 258,
  • sequence 294,
  • string 294,

Tools

  • Debug tools 31,

Utility

  • ansible-inventory 27,
  • ansible-pull 233,
  • ansible-runner 126,
  • jq 60,
  • passwordstore 234,

Vars

  • Precedence of the variables 33,
  • Scope of variables 158,
  • Special variables 17,
  • Substitution 188,
  • Test names in a block 23,
  • ansible_facts 165,
  • facts.d 177,
  • group_vars 71,
  • host_vars 28,
  • hostvars 216,
  • vars_prompt, pause 36,

vbotka.ansible_lib

  • al_bsd_service_facts 270,

Contents

Update README.md

To update README.md file go to the directory doc.

  • Update the file list_of_examples.yml if you want to update the list of examples in the contents and tags in the index. The structure of a line in this file is follows. If the example belongs to more categories add more lines wiht he same number of the example. The comment is optional.
     - Number_of_the_example. "Category; tag; tag; ... tag; Comment."
  • Update the template templates/README.md.j2 if you want to update the text.

  • Just type make to update README.md

     shell> ./make

License

license

Author Information

Vladimir Botka

More Repositories

1

ansible-linux-postinstall

Ansible role. Post-install configuration of Linux.
Shell
45
star
2

ansible-plugins

Various Ansible plugins.
Python
23
star
3

ansible-freebsd-postinstall

Ansible role. Post-install configuration of FreeBSD.
Jinja
21
star
4

ansible-freebsd-pf

Ansible role. Configure PF firewall in FreeBSD.
Jinja
13
star
5

ansible-freebsd-jail

Ansible role. FreeBSD Jail Management.
Shell
12
star
6

ansible-freebsd-mailserver

Ansible role. Install and configure postfix and dovecot2 with FreeBSD.
Jinja
7
star
7

ansible-certificate

Generate and/or check OpenSSL certificates
4
star
8

ansible-freebsd-dns

Ansible role. Install and configure DNS at FreeBSD.
Jinja
4
star
9

ansible-freebsd-poudriere

Install and configure Poudriere Build System in FreeBSD.
Jinja
4
star
10

ansible-lib

Ansible library of tasks.
3
star
11

ansible-freebsd-nagios

Ansible role. FreeBSD. Install and configure Nagios.
Jinja
3
star
12

ansible-freebsd-packages

Configure package repositories and Install and/or Update packages on FreeBSD.
Jinja
3
star
13

ansible-ansible

Install and configure Ansible.
HTML
3
star
14

ansible-freebsd-ports

Ansible role. Install and/or update ports at FreeBSD.
3
star
15

ansible-collection-freebsd

Ansible FreeBSD collection.
Jinja
3
star
16

ansible-freebsd-custom-image

Ansible role. FreeBSD. Download, mount, and customize system images.
Jinja
3
star
17

ansible-freebsd-zfs

Ansible role. FreeBSD. Configure ZFS.
2
star
18

ansible-nginx

Ansible role. Install and configure Nginx.
Jinja
2
star
19

ansible-freebsd-mailserver-roundcube

Ansible role. Install and configure Roundcube webmail on FreeBSD.
Jinja
2
star
20

ansible-freebsd-mailserver-sieve

Ansible role. Install and configure dovecot2-pigeonhole (Sieve RFC5228).
2
star
21

ansible-freebsd-network

Ansible role. FreeBSD. Configure network.
2
star
22

ansible-freebsd-redis

Ansible role. FreeBSD. Install and configure Redis.
Jinja
2
star
23

rcb

(Rsync-Crypto-Backup) encrypted backup solution
Shell
2
star
24

ansible-rsnapshot

Ansible role. Install and configure rsnapshot.
Jinja
1
star
25

ansible-config-light

Ansible role. Install packages, configure files and trigger handlers.
Shell
1
star
26

integrity

Lightweight file Intrusion Detection System (IDS).
Shell
1
star
27

ansible-freebsd-bash

Ansible.role. Install bash and change login shell to bash for specified users.
1
star
28

ansible-freebsd-mailserver-spamassassin

Ansible role. Install and configure spamassassin.
Shell
1
star
29

ansible-leutils

Ansible role. Install le-utils from github.com/vbotka/le-utils and configure cron to email a list of certificates that will expire in specified number of days. Optionaly dry-run renewals. Optionaly renew if there are certificates due for renewal.
Shell
1
star
30

ansible-freebsd-mysql

Ansible role. Install and configure MySQL at FreeBSD.
Jinja
1
star
31

ansible-integrity

Ansible.role. Install integrity from github.com/vbotka/integrity, record metadata (hash/mtree) of specified direcories and configure cron to email alerts about inconsistencies.
Jinja
1
star
32

ansible-freebsd-timezone

Ansible role. Configure timezone in FreeBSD.
1
star
33

ansible-freebsd-dhcp

Ansible role. Install and configure DHCP in FreeBSD.
Jinja
1
star
34

ansible-freebsd-php

Ansible role. FreeBSD. Install and configure PHP.
Shell
1
star
35

ansible-ucl

uclcmd module for Ansible
Python
1
star