Browse Source

Add lxc ansible tasks

pull/15/head
10sr 9 years ago
parent
commit
64bf32dc16
5 changed files with 14 additions and 17 deletions
  1. +5
    -0
      ansible/ansible.cfg
  2. +0
    -17
      ansible/local.sh
  3. +4
    -0
      ansible/lxc.yml
  4. +3
    -0
      ansible/roles/lxc/tasks/archlinux.yml
  5. +2
    -0
      ansible/roles/lxc/tasks/main.yml

+ 5
- 0
ansible/ansible.cfg View File

@@ -0,0 +1,5 @@
[defaults]
hostfile=local.hosts
nocows=1
[privilege_escalation]
become_ask_pass=True

+ 0
- 17
ansible/local.sh View File

@@ -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 <playbook> [...]"
exit 1
fi

ansible-playbook -i local.hosts --ask-sudo-pass "$@"

+ 4
- 0
ansible/lxc.yml View File

@@ -0,0 +1,4 @@
---
- hosts: all
roles:
- lxc

+ 3
- 0
ansible/roles/lxc/tasks/archlinux.yml View File

@@ -0,0 +1,3 @@
- name: Install LXC
pacman: name=lxc state=present
become: yes

+ 2
- 0
ansible/roles/lxc/tasks/main.yml View File

@@ -0,0 +1,2 @@
- include: archlinux.yml
when: ansible_os_family == "Archlinux"

Loading…
Cancel
Save