Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
|
- ---
-
- - hosts: lxd_containers
- remote_user: root
- gather_facts: false
- vars:
- lxd_source:
- type: image
- mode: pull
- server: https://images.linuxcontainers.org
- protocol: lxd
- alias: debian/buster/amd64
- tasks:
- - name: lxd container installed and started
- community.general.lxd_container:
- name: "{{inventory_hostname}}"
- state: started
- source: "{{lxd_source}}"
- profiles: ["default"]
- wait_for_ipv4_addresses: true
- timeout: 600
- delegate_to: "{{ lxd_host }}"
- - name: install python3 in lxd container
- command: lxc exec {{inventory_hostname}} -- apt-get -y install python3
- delegate_to: "{{ lxd_host }}"
-
- - hosts: lxd_containers
- remote_user: root
- connection: lxc_ssh
- gather_facts: false
- vars:
- ansible_host: "{{lxd_host}}"
- ansible_ssh_extra_args: "{{inventory_hostname}}"
- ssh_ip: "{{ansible_default_ipv6.address}}"
- tasks:
- - setup:
- - name: openssh server
- apt:
- pkg: openssh-server
- - name: make sure host_vars directory is present for host
- local_action: file
- args:
- path: "{{inventory_dir}}/host_vars/{{inventory_hostname}}"
- state: directory
- - name: record lxd containers IPv6 address for connection in host_vars
- local_action: copy
- args:
- content:
- ansible_host: "{{ssh_ip}}"
- ssh_ip: "{{ssh_ip}}"
- dest: "{{inventory_dir}}/host_vars/{{inventory_hostname}}/lxd_host.auto.json"
- - import_role:
- name: root_user
- - import_role:
- name: ssh_host_key
-
- - hosts: lxd_containers
- remote_user: root
|