Created
March 18, 2019 15:06
-
-
Save hypery2k/d9f7ebd4624e79c1a875c3d8a23102ba to your computer and use it in GitHub Desktop.
Ansible Playbook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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