From 64bf32dc1614532337be60b1c2dfebcc6cd65b94 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 10 Aug 2015 22:24:15 +0900 Subject: [PATCH] Add lxc ansible tasks --- ansible/ansible.cfg | 5 +++++ ansible/local.sh | 17 ----------------- ansible/lxc.yml | 4 ++++ ansible/roles/lxc/tasks/archlinux.yml | 3 +++ ansible/roles/lxc/tasks/main.yml | 2 ++ 5 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 ansible/ansible.cfg delete mode 100755 ansible/local.sh create mode 100644 ansible/lxc.yml create mode 100644 ansible/roles/lxc/tasks/archlinux.yml create mode 100644 ansible/roles/lxc/tasks/main.yml diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 0000000..1c9f39e --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +hostfile=local.hosts +nocows=1 +[privilege_escalation] +become_ask_pass=True diff --git a/ansible/local.sh b/ansible/local.sh deleted file mode 100755 index 63f01a5..0000000 --- a/ansible/local.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -set -e - -if ! command -v ansible-playbook >/dev/null -then - echo 'Command not found: ansible-playbook' - echo 'Install ansible first.' - exit 1 -fi - -if test $# -eq 0 -then - echo "usage: $0 [...]" - exit 1 -fi - -ansible-playbook -i local.hosts --ask-sudo-pass "$@" diff --git a/ansible/lxc.yml b/ansible/lxc.yml new file mode 100644 index 0000000..b6cb99a --- /dev/null +++ b/ansible/lxc.yml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - lxc diff --git a/ansible/roles/lxc/tasks/archlinux.yml b/ansible/roles/lxc/tasks/archlinux.yml new file mode 100644 index 0000000..31f92ec --- /dev/null +++ b/ansible/roles/lxc/tasks/archlinux.yml @@ -0,0 +1,3 @@ +- name: Install LXC + pacman: name=lxc state=present + become: yes diff --git a/ansible/roles/lxc/tasks/main.yml b/ansible/roles/lxc/tasks/main.yml new file mode 100644 index 0000000..a497e87 --- /dev/null +++ b/ansible/roles/lxc/tasks/main.yml @@ -0,0 +1,2 @@ +- include: archlinux.yml + when: ansible_os_family == "Archlinux"