Skip to content

Instantly share code, notes, and snippets.

@hypery2k
Created March 18, 2019 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hypery2k/d9f7ebd4624e79c1a875c3d8a23102ba to your computer and use it in GitHub Desktop.
Save hypery2k/d9f7ebd4624e79c1a875c3d8a23102ba to your computer and use it in GitHub Desktop.
Ansible Playbook
---
- name: Prepare | Setup Ansible runtime
hosts: all
gather_facts: no
tasks:
- name: Boostrap python
raw: test -e /usr/bin/python || (apt-get -y update && apt-get install -y python-minimal)
- name: Provision
hosts: all
tasks:
- name: Install init system
apt:
name: dumb-init
state: present
- name: Put runtime programs
copy:
src: files/{{ item }}
dest: /usr/local/bin/{{ item }}
mode: 0755
owner: root
group: root
with_items:
- docker-entrypoint.sh
- name: CleanUp | Remove package artificats and Ansible
hosts: all
gather_facts: no
tasks:
- name: Remove python
raw: apt-get purge -y python-minimal && apt-get autoremove -y
- name: Remove apt lists
raw: rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment