You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
630 B
28 lines
630 B
---
|
|
- name: Create debian containers for swarm
|
|
lxc_container:
|
|
name: "{{ item }}"
|
|
container_log: true
|
|
template: debian
|
|
state: stopped
|
|
fs_size: 2G
|
|
template_options: --release stretch -a amd64
|
|
container_command: |
|
|
if [ ! -d ~/.ssh ]; then
|
|
mkdir ~/.ssh
|
|
echo "{{ lookup('file', my_ssh_key) }}" | tee -a ~/.ssh/authorized_keys
|
|
systemctl restart sshd
|
|
fi
|
|
with_items:
|
|
- "worker1"
|
|
- "worker2"
|
|
# - "worker3"
|
|
tags: lxc
|
|
|
|
- name: Start lxc containers
|
|
shell: lxc-start --name {{ item }}
|
|
with_items:
|
|
- "worker1"
|
|
- "worker2"
|
|
# - "worker3"
|
|
tags: lxc
|
|
|