Skip to content

Instantly share code, notes, and snippets.

View goldyfruit's full-sized avatar
🦎

Gaëtan Trellu goldyfruit

🦎
View GitHub Profile
@goldyfruit
goldyfruit / inidata.py
Created March 4, 2016 16:04
[ansible] Add lookup plugin to parse initdata with ini_file module
# (c) 2016, Gaetan Trellu (goldyfruit) <[email protected]>
# (c) 2014, Pierre-Yves KERVIEL <[email protected]>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@goldyfruit
goldyfruit / pki.yml
Last active March 2, 2016 21:19
[ansible] Running keystone-manage pki_setup on one host and send SSL certificates on other nodes
---
- name: Ansible tests playbook
hosts: all
remote_user: root
tasks:
- name: Running PKI setup and creating a tarball with certificates
shell:
keystone-manage pki_setup --keystone-user keystone --keystone-group keystone && \
cd /etc/keystone/ && \
@goldyfruit
goldyfruit / pkg.yml
Last active December 16, 2020 09:40
[ansible] Check via the yum module and a registered value if a package is installed or not
---
- name: Ansible tests playbook
hosts: all
remote_user: root
tasks:
- name: Check if mariadb-libs-5.5.44-2.el7.centos.x86_64 package is installed
yum:
list=mariadb-libs-5.5*x86_64
register: pkg
@goldyfruit
goldyfruit / hosts
Last active February 16, 2016 23:16
[ansible] Generate the /etc/hosts with Ansible
#!/usr/bin/env python
import json
data = {
"openstack": {
"children": [
"controller"
],
"vars": {