Skip to content

Instantly share code, notes, and snippets.

View zeitounator's full-sized avatar

Olivier Clavel zeitounator

View GitHub Profile
---
- hosts: localhost
gather_facts: false
vars:
my_python_script_content: |-
import sys
sys.stdout.write('test')
tasks:
name = {{ item.name }}
username = {{ item.username }}
---
all:
vars:
ansible_connection: docker
hosts:
ans_centos7:
ans_centos8:
---
- name: this is play 1
hosts: my_hosts
tasks:
- name: this is task1 using the expect module
expect:
command: /bin/true
responses:
'response 1': answer 1
---
- hosts: localhost
gather_facts: false
vars:
cidre_version: "{{ lookup('file', '/tmp/VERSION', errors='ignore') | default('v0.1.0', true) }}"
tasks:
- name: Show initial version
debug:
[test_group]
localhost test_var=88
# This is the group definition used for the second run (remove previous)
# [test_group]
# localhost
[test_group:vars]
test_var=99
---
- hosts: localhost
gather_facts: false
vars:
test_values:
- no
- No
- "no"
- "No"
---
all:
vars:
ansible_python_interpreter: auto
hosts:
test:
ansible_connection: docker
---
all:
hosts:
my_vm_target:
ansible_host: 127.0.0.1
ansible_port: 2222
$ docker run -it --rm php:7.4.2-apache-buster bash -c "apt update && apt install -y libxslt1-dev && docker-php-ext-install xsl"
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [121 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [260 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [7860 B]
Fetched 8414 kB in 2s (4695 kB/s)
Reading package lists... Done
Building dependency tree