diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 007d85b..3b9241d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the codebase - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: - python-version: '3.x' + python-version: '3 - 3.13' - name: Install test dependencies run: | @@ -44,27 +44,24 @@ jobs: fail-fast: false matrix: include: - - distro: debian8 - - distro: debian9 - - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.10, <2.11' - distro: ubuntu1604 + ansible-version: '>=9, <10' - distro: ubuntu1804 - + ansible-version: '>=9, <10' steps: - name: Check out the codebase - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: path: "${{ github.repository }}" - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: - python-version: '3.x' + python-version: '3 - 3.13' - name: Install test dependencies - run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker + run: | + pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker - name: Run Molecule tests run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cc5164..45165e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the codebase - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Publish to Galaxy uses: robertdebock/galaxy-action@1.2.0 diff --git a/molecule/default/collections.yml b/molecule/default/collections.yml index c3d7e2a..1062b36 100644 --- a/molecule/default/collections.yml +++ b/molecule/default/collections.yml @@ -1,6 +1,2 @@ --- -collections: - - name: community.docker - version: '>=1.2.0,<2' - - name: community.general - version: '>=2,<3' +collections: [] diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 8841165..908aaf6 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -5,7 +5,7 @@ driver: name: docker platforms: - name: instance - image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest" + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw diff --git a/tasks/configure.yml b/tasks/configure.yml index d8637a2..83164b4 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -16,7 +16,7 @@ state: directory owner: "{{ twisted_connect_proxy_user }}" group: "{{ twisted_connect_proxy_group }}" - mode: 0755 + mode: '0755' with_items: "{{ _stat_directories.results }}" when: - item.stat is defined @@ -31,7 +31,7 @@ dest: "{{ item.dest }}" owner: root group: root - mode: 0644 + mode: '0644' with_items: - src: "{{ twisted_connect_proxy_etc_default_file.lstrip('/') }}.j2" dest: "{{ twisted_connect_proxy_etc_default_file }}" diff --git a/tasks/install.yml b/tasks/install.yml index e191031..c37308f 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -15,7 +15,7 @@ state: directory owner: root group: root - mode: 0755 + mode: '0755' tags: - twisted-connect-proxy-install-download - twisted-connect-proxy-install-download-directory @@ -26,7 +26,7 @@ dest: "{{ twisted_connect_proxy_downloads_path }}/server.py" owner: root group: root - mode: 0755 + mode: '0755' force: true notify: restart twisted-connect-proxy tags: diff --git a/tasks/main.yml b/tasks/main.yml index 0e7926f..e1b3be0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,7 +2,7 @@ --- - name: facts | set ansible.builtin.set_fact: - is_docker_guest: "{{ ansible_virtualization_role | default('host') == 'guest' and ansible_virtualization_type | default('none') == 'docker' }}" + is_docker_guest: "{{ ansible_facts['virtualization_role'] | default('host') == 'guest' and ansible_facts['virtualization_type'] | default('none') == 'docker' }}" tags: - configuration - twisted-connect @@ -49,13 +49,13 @@ block: - name: service upstart ansible.builtin.import_tasks: service-upstart.yml - when: ansible_service_mgr != 'systemd' + when: ansible_facts['service_mgr'] != 'systemd' tags: - twisted-connect-service-upstart - name: service systemd ansible.builtin.import_tasks: service-systemd.yml - when: ansible_service_mgr == 'systemd' + when: ansible_facts['service_mgr'] == 'systemd' tags: - twisted-connect-service-systemd diff --git a/tasks/service-initd.yml b/tasks/service-initd.yml index d907957..11e6711 100644 --- a/tasks/service-initd.yml +++ b/tasks/service-initd.yml @@ -6,7 +6,7 @@ dest: "{{ twisted_connect_proxy_etc_init_d_file }}" owner: root group: root - mode: 0755 + mode: '0755' notify: restart twisted-connect-proxy tags: - twisted-connect-proxy-service-initd-update diff --git a/tasks/service-systemd.yml b/tasks/service-systemd.yml index cfa95df..ed8a111 100644 --- a/tasks/service-systemd.yml +++ b/tasks/service-systemd.yml @@ -6,7 +6,7 @@ dest: "{{ twisted_connect_proxy_etc_systemd_file }}" owner: root group: root - mode: 0644 + mode: '0644' register: _update_systemd_script notify: restart twisted-connect-proxy tags: diff --git a/tasks/service-upstart.yml b/tasks/service-upstart.yml index a714a39..82c90f7 100644 --- a/tasks/service-upstart.yml +++ b/tasks/service-upstart.yml @@ -6,7 +6,7 @@ dest: "{{ twisted_connect_proxy_etc_init_file }}" owner: root group: root - mode: 0644 + mode: '0644' notify: restart twisted-connect-proxy tags: - twisted-connect-proxy-service-upstart-update diff --git a/tests/tasks/post.yml b/tests/tasks/post.yml index f4a0d4c..e59a779 100644 --- a/tests/tasks/post.yml +++ b/tests/tasks/post.yml @@ -10,7 +10,7 @@ - name: test proxy installation # noqa command-instead-of-module ansible.builtin.command: > - curl -sL --head https://www.google.com --proxy http://{{ ansible_lo['ipv4']['address'] }}:{{ twisted_connect_proxy_port }} + curl -sL --head https://www.google.com --proxy http://{{ ansible_facts['lo']['ipv4']['address'] }}:{{ twisted_connect_proxy_port }} register: _result changed_when: false failed_when: _result.stdout.find('HTTP/1.1 200 CONNECT OK') == -1 diff --git a/tests/test.yml b/tests/test.yml index 4ad8383..8cc4c83 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,6 +1,7 @@ # test file --- -- hosts: localhost +- name: converge + hosts: localhost connection: local become: true pre_tasks: diff --git a/tests/vagrant.yml b/tests/vagrant.yml index 09c6f19..9f9261b 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -1,6 +1,7 @@ # test file --- -- hosts: all +- name: converge + hosts: all remote_user: vagrant become: true pre_tasks: