Skip to content

Instantly share code, notes, and snippets.

---
- name: test nested blocks
hosts: localhost
tasks:
- block:
- name: first outer level task
debug:
msg: first outer level task
- block:
- name: first inner level task
@richm
richm / gist:25cef183fae583e15ff871f2d500ab57
Created November 13, 2020 17:44
nested block with error handling
---
- name: test nested blocks
hosts: localhost
tasks:
- block:
- name: first outer level task
debug:
msg: first outer level task
- block:
- name: first inner level task
---
- name: set parameters for test
hosts: localhost
tasks:
- set_fact:
vpn_connections:
- type: psk
hosts:
hosta:
hostb:
vpn_provider_default: libreswan
vpn_enc_alg: AES-GCM
vpn_lifetime: 1 # hour
vpn_connections:
- name: my_conn_1
local:
ip:
hostname:
remote:
ip:
--- ./tests/tests_change_fs.yml 2020-09-03 18:14:46.369832510 -0600
+++ ./tests/tests_change_fs.yml.lsrout 2020-09-09 17:48:40.217752539 -0600
@@ -4,9 +4,10 @@
vars:
storage_safe_mode: false
mount_location: '/opt/test1'
volume_size: '5g'
- fs_after: "{{ (ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6') | ternary('ext4', 'xfs') }}"
+ fs_after: "{{ (ansible_distribution == 'RedHat' and ansible_distribution_major_version\
+ \ == '6') | ternary('ext4', 'xfs') }}"
--- ./examples/macvlan.yml 2020-09-03 18:14:44.302820045 -0600
+++ ./examples/macvlan.yml.lsrout 2020-09-09 17:48:30.434693683 -0600
@@ -18,10 +18,10 @@
state: up
parent: eth0
macvlan:
mode: bridge
- promiscuous: True
- tap: False
+ promiscuous: true
./examples/bond_simple.yml.lsrout
./examples/wireless_wpa_psk.yml.lsrout
./examples/eth_with_802_1x.yml.lsrout
--- ./examples/macvlan.yml 2020-09-03 18:14:44.302820045 -0600
+++ ./examples/macvlan.yml.lsrout 2020-09-09 17:48:30.434693683 -0600
@@ -18,10 +18,10 @@
state: up
parent: eth0
macvlan:
mode: bridge
---
- hosts: node.example.com
become: true
tasks:
- name: Copy client key for 802.1x authentication
copy:
src: "/srv/data/client.key"
dest: "/etc/pki/tls/private/client.key"
mode: 0600
{% if rsyslog_flows | length > 0 %}
{% for flow in rsyslog_flows %}
{% for input_name in flow.inputs %}
{% if rsyslog_input_basics.0.name == input_name %}
{% if __basics_first_time == true %}
if $inputname == "imjournal" then {
{% endif %}
{% for flow_output in flow.outputs %}
example1:
old:
kernel_settings_parameters:
sysctl:
vm.swappiness: 40
kernel_settings_operations:
sysctl:
- {"del": "vm.swappiness"}
new:
kernel_settings_parameters: