# 2023-09-25 # Tasks: vm --- - ansible.builtin.include_vars: vault/domain.yml - ansible.builtin.include_vars: vault/vm.yml - ansible.builtin.include_vars: vault/ports.yml - ansible.builtin.include_vars: vm.yml # # Setup Docker VM base # - name: Process /etc/hosts template ansible.builtin.template: backup: true src: "{{ vm_template_hosts }}" dest: "{{ vm_template_hosts_distribution }}" owner: root group: root mode: u=rw,g=r,o=r when: - ansible_facts['system'] == "Linux" tags: - template - system - hosts - update - name: Create Docker root directory ansible.builtin.file: path: "{{ vm_docker_root }}" owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" state: directory mode: u=rwx,g=rx,o=rx when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - directories - create - name: Create Docker template directory ansible.builtin.file: path: "{{ vm_template_root_vm }}" owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" state: directory mode: u=rwx,g=rx,o=rx when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - directories - create - name: Process Docker template files ansible.builtin.template: src: "{{ item.template }}" dest: "{{ vm_template_root_vm }}/{{ item.file }}" owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" mode: u=rw,g=r,o=r loop: - { template: '{{ vm_template_host }}', file: '{{ vm_template_host_name }}' } - { template: '{{ vm_template_vpn }}', file: '{{ vm_template_vpn_name }}' } - { template: '{{ vm_template_common }}', file: '{{ vm_template_common_name }}' } - { template: '{{ vm_template_env }}', file: '{{ vm_template_env_name }}' } when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - templates - add - name: Process Docker scripts template files ansible.builtin.template: src: "{{ item.template }}" dest: "{{ vm_template_scripts_root }}/{{ item.file }}" owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" mode: u=rwx,g=rx,o=rx loop: - { template: '{{ vm_template_script_network }}', file: '{{ vm_template_script_network_name }}' } - { template: '{{ vm_template_script_rights }}', file: '{{ vm_template_script_rights_name }}' } - { template: '{{ vm_template_script_stacks }}', file: '{{ vm_template_script_stacks_name }}' } when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - templates - add - name: Create stacks required files (empty) ansible.builtin.file: path: "{{item }}" state: touch owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" mode: u=rw,g=r,o=r loop: - "{{ vm_stack_logpath }}/{{ vm_stack_logfile }}" when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - stacks - files - touch - name: Create stacks selector files ansible.builtin.template: src: "{{ vm_stack_selector_template }}" dest: "{{ item.file }}" owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" mode: u=rw,g=r,o=r loop: - { file: '{{ vm_template_root_vm }}/{{ vm_stack_available }}' } - { file: '{{ vm_template_root_vm }}/{{ vm_stack_before }}' } - { file: '{{ vm_template_root_vm }}/{{ vm_stack_current }}' } - { file: '{{ vm_template_root_vm }}/{{ vm_stack_after }}' } - { file: '{{ vm_template_root_vm }}/{{ vm_stack_stop }}' } when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - stacks - selector - add - name: Create stacks backups exlusions file ansible.builtin.template: src: "{{ vm_stack_excluded_template }}" dest: "{{ vm_stack_excluded_template_name }}" owner: "{{ vm_puid }}" group: "{{ vm_pgid }}" mode: u=rw,g=r,o=r when: - ansible_facts['system'] == "Linux" tags: - system - vm - docker - stacks - selector - add