Skip to content

Instantly share code, notes, and snippets.

View alvaroaleman's full-sized avatar

Alvaro Aleman alvaroaleman

View GitHub Profile
#!/bin/bash
set -eu
x=(333,343,353,363)
y=(0.025,0.05,0.1,0.2)
z=(a,b,c,d,e,f)
IFS=','
---
- hosts: localhost
vars:
dictionary:
- method: msg
value: "Hello World"
tasks:
- name: Test
with_items: dictionary
action: debug
---
- hosts: localhost
roles:
- openstack/neutron
---
- hosts: localhost
vars:
file: /tmp/docker_compose
tasks:
- name: Create file with wrong checksum
copy:
dest: "{{ file }}"
content: 'Filecontent'
- name: Run get_url
---
- hosts: localhost
tasks:
- name: Demo
with_items: ['blue', 'red']
when: item == 'blue'
debug:
var: '{{ item }}'
- name: Install a packge
with_items:
- packageA
- packageB
- packageC
when: packages.item
apt:
name: "{{ item }}"
# configure ansible-galaxy
config.vm.provision :ansible do |ansible|
ansible.galaxy_roles_path = 'tests/roles/'
ansible.galaxy_role_file = 'tests/requirements.yml'
ansible.galaxy_command = 'ansible-galaxy install --role-file=%{role_file} --roles-path=%{roles_path} --ignore-errors --force'
end
---
- name: Reboot
tags: reboot
become: true
async: 1
poll: 0
shell: sleep 5 && /sbin/shutdown -r now
- name: Wait for ssh to come back
tags: reboot
#!/usr/bin/env bash
set -euxo pipefail
ADDR=127.0.0.1:8300
VAULT_ADDR=http://$ADDR
VAULT_TOKEN=123
CT_VERSION=0.19.1
if ! [[ -e vault_0.8.1_linux_amd64.zip ]]; then
#!/usr/bin/env bash
set -euxo pipefail
ADDR=127.0.0.1:8300
VAULT_ADDR=http://$ADDR
VAULT_TOKEN=123
CT_VERSION=0.19.0
if ! [[ -e vault_0.8.1_linux_amd64.zip ]]; then