--- - name: 'Create themelio-node TestNet image' hosts: themelio_node become: yes tasks: - name: Upgrade the system ansible.builtin.apt: upgrade: safe update_cache: yes - name: Reboot the system reboot: reboot_timeout: 3600 - name: Install gnupg and docker python module ansible.builtin.apt: name: - gnupg - python3-docker update_cache: yes state: latest - name: Add Docker apt key. apt_key: url: https://download.docker.com/linux/debian/gpg state: present - name: Add Docker repositories to apt apt_repository: repo: "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" state: present - name: Install docker packages ansible.builtin.apt: name: - docker-ce - docker-ce-cli - containerd.io state: latest - name: Install docker-compose ansible.builtin.get_url: url: https://github.com/docker/compose/releases/download/v2.0.1/docker-compose-linux-x86_64 dest: /usr/local/bin/docker-compose mode: a+x - name: Enable the docker service ansible.builtin.service: name: docker enabled: yes - name: Add the admin user to the docker group ansible.builtin.user: name: admin groups: docker append: yes - name: Start the docker service ansible.builtin.service: name: docker state: started - name: Create the compose directory ansible.builtin.file: path: /home/admin/compose state: directory - name: Copy the docker-compose template to the server ansible.builtin.template: src: docker-compose.testnet.yml.j2 dest: /home/admin/compose/docker-compose.yml - name: Copy the promtail configuration to the server ansible.builtin.template: src: promtail.toml.j2 dest: /home/admin/compose/promtail.toml - name: Copy the themelio-node systemd service file onto the server ansible.builtin.copy: src: themelio-node.service dest: /usr/lib/systemd/system/themelio-node.service - name: Enable and start the themelio-node service ansible.builtin.systemd: name: themelio-node daemon_reload: yes state: started enabled: yes - name: Copy the update-images-and-restart systemd service file onto the server ansible.builtin.copy: src: update-images-and-restart.service-testnet dest: /usr/lib/systemd/system/update-images-and-restart.service - name: Copy the update-images-and-restart systemd timer file onto the server ansible.builtin.copy: src: update-images-and-restart.timer dest: /usr/lib/systemd/system/update-images-and-restart.timer - name: Enable and start the update-images-and-restart timer ansible.builtin.systemd: name: update-images-and-restart.timer daemon_reload: yes state: started enabled: yes