Created
August 31, 2018 06:54
-
-
Save ktechmidas/ffd89d57e59fe5829d900ae07fd7844c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
- hosts: localhost | |
connection: local | |
tasks: | |
- name: Create a started container | |
lxd_container: | |
name: web | |
state: started | |
source: | |
type: image | |
mode: pull | |
server: https://images.linuxcontainers.org | |
protocol: lxd | |
alias: ubuntu/xenial/amd64 | |
profiles: ["default"] | |
wait_for_ipv4_addresses: true | |
timeout: 600 | |
- name: check python is installed in container | |
delegate_to: web | |
raw: dpkg -s python | |
register: python_install_check | |
failed_when: python_install_check.rc not in [0, 1] | |
changed_when: false | |
- name: install python in container | |
delegate_to: web | |
raw: apt-get install -y python | |
when: python_install_check.rc == 1 | |
- name: Install nginx | |
delegate_to: web | |
apt: | |
name: nginx | |
update_cache: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment