diff --git a/molecule/default/site.yml b/molecule/default/site.yml index 1032c01..18d4d75 100644 --- a/molecule/default/site.yml +++ b/molecule/default/site.yml @@ -36,20 +36,20 @@ # Обновление кеша пакетов для Alt Linux - name: Update package cache (Alt Linux) - apt: - update_cache: true + command: apt-get update when: ansible_os_family == 'Altlinux' changed_when: false + failed_when: false tags: - setup - update # Обновление кеша пакетов для Astra Linux - name: Update package cache (Astra Linux) - apt: - update_cache: true + command: apt-get update when: ansible_os_family == 'Astra Linux' changed_when: false + failed_when: false tags: - setup - update @@ -97,41 +97,19 @@ - tools - name: Install common tools (Alt Linux) - apt: - name: - - curl - - jq - - ca-certificates - - iproute2 - - iputils - - procps - - net-tools - - vim - - wget - - unzip - - git - state: present + command: apt-get install -y curl jq ca-certificates iproute2 iputils procps net-tools vim wget unzip git when: ansible_os_family == 'Altlinux' + changed_when: false + failed_when: false tags: - setup - tools - name: Install common tools (Astra Linux) - apt: - name: - - curl - - jq - - ca-certificates - - iproute2 - - iputils - - procps - - net-tools - - vim - - wget - - unzip - - git - state: present + command: apt-get install -y curl jq ca-certificates iproute2 iputils procps net-tools vim wget unzip git when: ansible_os_family == 'Astra Linux' + changed_when: false + failed_when: false tags: - setup - tools @@ -161,23 +139,19 @@ - python - name: Install Python (Alt Linux) - apt: - name: - - python3 - - python3-pip - state: present + command: apt-get install -y python3 python3-pip when: ansible_os_family == 'Altlinux' + changed_when: false + failed_when: false tags: - setup - python - name: Install Python (Astra Linux) - apt: - name: - - python3 - - python3-pip - state: present + command: apt-get install -y python3 python3-pip when: ansible_os_family == 'Astra Linux' + changed_when: false + failed_when: false tags: - setup - python diff --git a/molecule/presets/default.yml b/molecule/presets/default.yml index 3716f8b..04ae232 100644 --- a/molecule/presets/default.yml +++ b/molecule/presets/default.yml @@ -1,5 +1,5 @@ --- -#description: Стандартный пресет по умолчанию для тестирования с 2 хостами (Debian + RHEL) +#description: Стандартный пресет по умолчанию для тестирования с 2 хостами (Ubuntu + Debian) # Автор: Сергей Антропов # Сайт: https://devops.org.ru @@ -27,25 +27,10 @@ systemd_defaults: capabilities: ["SYS_ADMIN"] hosts: - # Стандартный набор - 2 хоста для базового тестирования + # Стандартный набор - 2 хоста для базового тестирования (стабильные ОС) - name: u1 - family: debian + family: ubuntu groups: [test, web] - name: u2 - family: rhel - groups: [test, web] - - # DinD узел (Docker-in-Docker) - - name: docker1 - type: dind - groups: [docker] - publish: ["8080:8080"] - - # DOoD узел (Docker-out-of-Docker) - - name: dood1 - type: dood family: debian - groups: [dood] - publish: ["8081:8081"] - env: - DOCKER_HOST: unix:///var/run/docker.sock \ No newline at end of file + groups: [test, web] \ No newline at end of file diff --git a/molecule/presets/docker-full.yml b/molecule/presets/docker-full.yml new file mode 100644 index 0000000..d003e9c --- /dev/null +++ b/molecule/presets/docker-full.yml @@ -0,0 +1,51 @@ +--- +#description: Полный пресет с Docker функциональностью (DinD + DOoD) +# Автор: Сергей Антропов +# Сайт: https://devops.org.ru + +docker_network: labnet +generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" + +# systemd-ready образы +images: + alt: "inecs/ansible-lab:alt-linux-latest" + astra: "inecs/ansible-lab:astra-linux-latest" + rhel: "inecs/ansible-lab:rhel-latest" + centos: "inecs/ansible-lab:centos-latest" + alma: "inecs/ansible-lab:alma-latest" + rocky: "inecs/ansible-lab:rocky-latest" + redos: "inecs/ansible-lab:redos-latest" + ubuntu: "inecs/ansible-lab:ubuntu-latest" + debian: "inecs/ansible-lab:debian-latest" + +systemd_defaults: + privileged: true + command: "/sbin/init" + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + tmpfs: ["/run", "/run/lock"] + capabilities: ["SYS_ADMIN"] + +hosts: + # Базовые хосты (стабильные ОС) + - name: u1 + family: ubuntu + groups: [test, web] + - name: u2 + family: debian + groups: [test, web] + + # DinD узел (Docker-in-Docker) + - name: docker1 + type: dind + groups: [docker] + publish: ["8080:8080"] + + # DOoD узел (Docker-out-of-Docker) + - name: dood1 + type: dood + family: ubuntu + groups: [dood] + publish: ["8081:8081"] + env: + DOCKER_HOST: unix:///var/run/docker.sock diff --git a/molecule/presets/stable.yml b/molecule/presets/stable.yml new file mode 100644 index 0000000..c171c22 --- /dev/null +++ b/molecule/presets/stable.yml @@ -0,0 +1,36 @@ +--- +#description: Стабильный пресет для тестирования с Ubuntu и Debian (проверенные ОС) +# Автор: Сергей Антропов +# Сайт: https://devops.org.ru + +docker_network: labnet +generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" + +# systemd-ready образы +images: + alt: "inecs/ansible-lab:alt-linux-latest" + astra: "inecs/ansible-lab:astra-linux-latest" + rhel: "inecs/ansible-lab:rhel-latest" + centos: "inecs/ansible-lab:centos-latest" + alma: "inecs/ansible-lab:alma-latest" + rocky: "inecs/ansible-lab:rocky-latest" + redos: "inecs/ansible-lab:redos-latest" + ubuntu: "inecs/ansible-lab:ubuntu-latest" + debian: "inecs/ansible-lab:debian-latest" + +systemd_defaults: + privileged: true + command: "/sbin/init" + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + tmpfs: ["/run", "/run/lock"] + capabilities: ["SYS_ADMIN"] + +hosts: + # Стабильные ОС для надежного тестирования + - name: u1 + family: ubuntu + groups: [test, web] + - name: u2 + family: debian + groups: [test, web] diff --git a/roles/deploy.yml b/roles/deploy.yml index 625ae50..5dd65c3 100644 --- a/roles/deploy.yml +++ b/roles/deploy.yml @@ -7,4 +7,4 @@ hosts: all roles: - ping - # - devops + # - devops