-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Some code updates * New path to unix.socket * Code yaml corrected * Add item.url * Install lxd only from snap * Inventory update * Disable security apparmor for nested containers * Spell correct * Add dependencies * Inventory updates Inventory localhost No zfs for trusy Default pool driver to dir Default driver conditional Pre task Correct code State absent Add user travis Create lxd group and add user to it Xenial on travis Install zfsutils zfsutils-linux List var/snap directory Ls var lxd init --auto Lxd configuration only Install lxd in travis Install with sudo Correct conditional Restart lxd service Install lxd from role Restart services Start lxd service Masked no Restart snap.lxd.daemon Snap.lxc restarted Install lxd only if not available Lxd conditional
- Loading branch information
1 parent
d5efe2d
commit 7018824
Showing
13 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
remote_tmp = /tmp/.ansible-${USER}/tmp | ||
local_tmp = $HOME/.ansible/tmp | ||
pipelining=True | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
|
||
- name: Install dependencies | ||
apt: | ||
name: '{{ item }}' | ||
update_cache: true | ||
with_items: | ||
- software-properties-common | ||
- snapd | ||
- zfsutils-linux |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
--- | ||
- name: Ensure APT LXD repository (stable) | ||
apt_repository: repo='ppa:ubuntu-lxc/lxd-stable' update_cache='yes' | ||
when: lxd_apt_stable_repo | ||
|
||
- name: Install LXD | ||
package: name={{ item }} state=present | ||
with_items: '{{ lxd_packages }}' | ||
- name: Ensure there is no lxd installed from repo | ||
apt: | ||
name: '{{ item }}' | ||
state: absent | ||
with_items: | ||
- lxd | ||
- lxd-client | ||
|
||
- name: Create lxd group | ||
group: | ||
name: lxd | ||
state: present | ||
|
||
- name: Add users to lxd group | ||
user: name={{ item }} groups=lxd append=yes | ||
user: | ||
name: '{{ item }}' | ||
groups: lxd | ||
append: true | ||
with_items: '{{ lxd_users }}' | ||
register: lxd_group_users_status | ||
|
||
- name: Install LXD with snap | ||
shell: snap install {{ item }} | ||
with_items: | ||
- lxd --channel=3.0 | ||
when: lxd_install == "true" | ||
changed_when: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
--- | ||
|
||
- include: install.yml | ||
- import_tasks: dependencies.yml | ||
tags: [lxd, lxd-install] | ||
|
||
- include: configure.yml | ||
- import_tasks: install.yml | ||
tags: [lxd, lxd-install] | ||
|
||
- import_tasks: configure.yml | ||
tags: [lxd, lxd-configure] | ||
|
||
- include: containers.yml | ||
- import_tasks: containers.yml | ||
tags: [lxd, lxd-containers] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
security.nesting=true | ||
security.privileged=true | ||
raw.lxc: |- | ||
lxc.apparmor.profile=unconfined | ||
lxc.cgroup.devices.allow=a |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
localhost ansible_connection=local | ||
# lxc-test ansible_connection=lxd ansible_python_interpreter='/usr/bin/python3' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,40 @@ | ||
--- | ||
|
||
- hosts: localhost | ||
become: True | ||
- hosts: all | ||
become: true | ||
roles: | ||
- role: plumelo.lxd | ||
lxd_packages: ['lxd'] | ||
lxd_install: false | ||
lxd_users: ['travis'] | ||
lxd_dns_ipv4: '10.229.31.1' | ||
lxd_prepend_dns: ['{{ lxd_dns_ipv4 }}'] | ||
lxd_default_bridge_ipv4_address: '{{ lxd_dns_ipv4 }}/24' | ||
lxd_default_pool_driver: dir | ||
lxd_default_pool_config: {} | ||
cloud_config: | ||
package_upgrade: true | ||
manage_etc_hosts: true | ||
hostname: xenial | ||
packages: | ||
- python | ||
- acl | ||
- sudo | ||
lxd_user_data: "#cloud-config\n{{ cloud_config|to_yaml(indent=2) }}" | ||
lxd_containers: | ||
- name: xenial | ||
state: started | ||
become_user: travis | ||
alias: 'x' | ||
config: | ||
user.user-data: "#cloud-config\n{{ cloud_config|combine({'hostname': 'xenial'})|to_yaml(indent=2) }}" | ||
security.nesting: 'true' | ||
security.privileged: 'true' | ||
user.user-data: "{{lxd_user_data}}" | ||
devices: {} | ||
timeout: 600 | ||
|
||
# lxc_config: | ||
# security.nesting=true | ||
# security.privileged=true | ||
# raw.lxc: |- | ||
# lxc.apparmor.profile=unconfined | ||
# lxc.cgroup.devices.allow=a |