From 239b122c13fb7a2dcaf0441faf8366f453fc9b5b Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Mon, 7 Oct 2024 16:44:57 +0200 Subject: [PATCH] dinamically use debian or ubuntu depending on the server's OS --- project/{{ cookiecutter.__folder_name }}/devops/README.md | 6 ++++++ .../devops/tasks/base/task_docker.yml | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/project/{{ cookiecutter.__folder_name }}/devops/README.md b/project/{{ cookiecutter.__folder_name }}/devops/README.md index 39c2053..0a8b563 100644 --- a/project/{{ cookiecutter.__folder_name }}/devops/README.md +++ b/project/{{ cookiecutter.__folder_name }}/devops/README.md @@ -51,6 +51,12 @@ STACK_NAME={{ cookiecutter.__devops_stack_name }} Note: The `.env` file is included in `.gitignore`, ensuring environment-specific configurations aren't pushed to the repository. + +### Server installation + +You need to Ubuntu or Debian in {{ cookiecutter.hostname }}, enable SSH and install python3 there. + + ### Ansible Installation Execute the following to create a Python 3 virtual environment and install Ansible along with its dependencies: diff --git a/project/{{ cookiecutter.__folder_name }}/devops/tasks/base/task_docker.yml b/project/{{ cookiecutter.__folder_name }}/devops/tasks/base/task_docker.yml index 2462c25..ee77022 100644 --- a/project/{{ cookiecutter.__folder_name }}/devops/tasks/base/task_docker.yml +++ b/project/{{ cookiecutter.__folder_name }}/devops/tasks/base/task_docker.yml @@ -42,18 +42,18 @@ block: - name: "Docker: Add GnuPG key" ansible.builtin.apt_key: - url: https://download.docker.com/linux/ubuntu/gpg + url: https://download.docker.com/linux/{{ ansible_lsb.id | lower }}/gpg state: present - name: "Docker: Add Repository (amd64)" ansible.builtin.apt_repository: - repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable" + repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_lsb.id | lower }} {{ ansible_lsb.codename }} stable" state: present filename: 'docker' - name: "Docker: Add Repository (arm64)" ansible.builtin.apt_repository: - repo: "deb [arch=arm64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable" + repo: "deb [arch=arm64] https://download.docker.com/linux/{{ ansible_lsb.id | lower }} {{ ansible_lsb.codename }} stable" state: present filename: 'docker' tags: