Skip to content

Instantly share code, notes, and snippets.

vpn_provider_default: libreswan
vpn_enc_alg: AES-GCM
vpn_lifetime: 1 # hour
vpn_connections:
- name: my_conn_1
local:
ip:
hostname:
remote:
ip:
---
- name: set parameters for test
hosts: localhost
tasks:
- set_fact:
vpn_connections:
- type: psk
hosts:
hosta:
hostb:
@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: 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 collection paths
set_fact:
collection_paths: |
{{
(lookup("env","ANSIBLE_COLLECTIONS_PATH").split(":") +
lookup("env","ANSIBLE_COLLECTIONS_PATHS").split(":") +
lookup("config", "COLLECTIONS_PATHS")) |
select | list
}}
from kubernetes import client, config
from openshift.dynamic import DynamicClient
k8s_client = config.new_client_from_config()
dyn_client = DynamicClient(k8s_client)
v1_projects = dyn_client.resources.get(api_version='project.openshift.io/v1', kind='Project')
project_list = v1_projects.get()
I used the following inventory:
all:
hosts:
host1.local:
host2.local:
host3.local:
host4.local:
vars:
vpn_connections:
- hosts: localhost
vars:
nodenames: [node1, node2, node3]
tasks:
- name: add nodes
add_host:
name: "{{ item }}"
foo: bar
ha_cluster:
node_name: "{{ item ~ '-ha' }}"
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build hello world",
"type": "shell",
"command": "gfortran -o hello helloworld.f90",
"problemMatcher": [],