Commit b8471719 authored by Mattia Rizzolo's avatar Mattia Rizzolo

lxd-container: rename variable

for some reason ansible is now failing with a variable named "name",
claiming it is not defined.  just rename it, making it also more clear
what it is referring to.
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mapreri@ubuntu.com>
parent be7e6491
......@@ -30,13 +30,13 @@
- role: lxd
- role: lxd-container
name: spock
container_name: spock
ip: "{{ lxd_subnet }}.2"
image: ubuntu/xenial/amd64
expose_ports:
- 2222
- role: lxd-container
name: bromuro
container_name: bromuro
ip: "{{ lxd_subnet }}.3"
image: ubuntu/trusty/amd64
---
- name: "Create the {{ name }} container"
- name: "Create the {{ container_name }} container"
lxd_container:
name: "{{ name }}"
name: "{{ container_name }}"
state: started
source:
......@@ -19,20 +19,20 @@
- block:
- name: "Upload the bootstrap script for the {{ name }} container"
- name: "Upload the bootstrap script for the {{ container_name }} container"
template:
src: bootstrap-container.sh.j2
dest: "/tmp/bootstrap-container-{{ name }}.sh"
dest: "/tmp/bootstrap-container-{{ container_name }}.sh"
mode: 0700
- name: "Execute the bootstrap script for the {{ name }} container"
command: "/tmp/bootstrap-container-{{ name }}.sh"
- name: "Execute the bootstrap script for the {{ container_name }} container"
command: "/tmp/bootstrap-container-{{ container_name }}.sh"
- name: "Delete the bootstrap script for the {{ name }} container"
- name: "Delete the bootstrap script for the {{ container_name }} container"
file:
path: "/tmp/bootstrap-container-{{ name }}.sh"
path: "/tmp/bootstrap-container-{{ container_name }}.sh"
state: absent
......
---
- name: "Assign a static IP address to the {{ name }} container"
- name: "Assign a static IP address to the {{ container_name }} container"
lineinfile:
line: "dhcp-host={{ name }},{{ ip }}"
regexp: "^dhcp\\-host={{ name }}"
line: "dhcp-host={{ container_name }},{{ ip }}"
regexp: "^dhcp\\-host={{ container_name }}"
state: present
path: /etc/lxd_dnsmasq.conf
notify:
- lxd.restart-bridge
- "lxd-container.restart-{{ name }}"
- "lxd-container.restart-{{ container_name }}"
- name: "Expose {{ name }} ports"
- name: "Expose {{ container_name }} ports"
template:
src: firewall.sh.j2
dest: "/etc/firewall/lxd-container-{{ name }}.sh"
dest: "/etc/firewall/lxd-container-{{ container_name }}.sh"
mode: 0744
when: expose_ports
......
......@@ -3,10 +3,10 @@ set -euo pipefail
IFS=$'\n\t'
NAME="{{ name }}"
NAME="{{ container_name }}"
ex() {
lxc exec "${NAME}" -- $@
lxc exec "${NAME}" -- "${@}"
return $?
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment