diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f7278a..054297c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,14 +44,11 @@ jobs: fail-fast: false matrix: include: - - distro: debian8 - - distro: debian9 - - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.10, <2.11' - - distro: ubuntu1604 - distro: ubuntu1804 + ansible-version: '>=9, <10' - distro: ubuntu2004 + - distro: ubuntu2204 + - distro: ubuntu2404 steps: - name: Check out the codebase @@ -65,8 +62,8 @@ jobs: python-version: '3.x' - name: Install test dependencies - run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker - + run: | + pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker - name: Run Molecule tests run: | molecule test diff --git a/Vagrantfile b/Vagrantfile index 8868feb..4e0b72f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,13 +4,6 @@ role = File.basename(File.expand_path(File.dirname(__FILE__))) boxes = [ - { - :name => "ubuntu-1604", - :box => "bento/ubuntu-16.04", - :ip => '10.0.0.12', - :cpu => "50", - :ram => "256" - }, { :name => "ubuntu-1804", :box => "bento/ubuntu-18.04", @@ -23,7 +16,21 @@ boxes = [ :box => "bento/ubuntu-20.04", :ip => '10.0.0.14', :cpu => "50", - :ram => "384" + :ram => "512" + }, + { + :name => "ubuntu-2204", + :box => "bento/ubuntu-22.04", + :ip => '10.0.0.15', + :cpu => "50", + :ram => "512" + }, + { + :name => "ubuntu-2404", + :box => "bento/ubuntu-24.04", + :ip => '10.0.0.16', + :cpu => "50", + :ram => "512" }, ] diff --git a/handlers/main.yml b/handlers/main.yml index e28ba49..1ecce34 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,4 +4,5 @@ ansible.builtin.service: name: autossh-tunnel-client state: restarted + use: "{{ service_use_service_mgr | default(omit) }}" when: service_default_state | default('started') == 'started' diff --git a/meta/main.yml b/meta/main.yml index 13760e0..492a9bd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -10,9 +10,10 @@ galaxy_info: platforms: - name: Ubuntu versions: - - xenial - bionic - focal + - jammy + - noble galaxy_tags: - system - networking 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/main.yml b/tasks/main.yml index 722f0c8..00a51c6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,17 +27,22 @@ - autossh-tunnel-client-configure - name: service - block: - - name: service-initd - ansible.builtin.import_tasks: service-initd.yml when: is_docker_guest tags: - configuration - autossh-tunnel-client - autossh-tunnel-client-service - autossh-tunnel-client-service-initd + block: + - name: service-initd + ansible.builtin.import_tasks: service-initd.yml - name: service + when: not is_docker_guest + tags: + - configuration + - autossh-tunnel-client + - autossh-tunnel-client-service block: - name: service upstart ansible.builtin.import_tasks: service-upstart.yml @@ -50,17 +55,13 @@ when: ansible_service_mgr == 'systemd' tags: - autossh-tunnel-client-service-systemd - when: not is_docker_guest - tags: - - configuration - - autossh-tunnel-client - - autossh-tunnel-client-service - name: start and enable service ansible.builtin.service: name: autossh-tunnel-client state: "{{ service_default_state | default('started') }}" enabled: "{{ service_default_enabled | default(true) | bool }}" + use: "{{ service_use_service_mgr | default(omit) }}" tags: - configuration - autossh-tunnel-client diff --git a/tasks/service-initd.yml b/tasks/service-initd.yml index 9a4ab9c..cbb3b5b 100644 --- a/tasks/service-initd.yml +++ b/tasks/service-initd.yml @@ -6,7 +6,7 @@ dest: "{{ autossh_tunnel_client_etc_init_d_file }}" owner: root group: root - mode: 0755 + mode: '0755' notify: restart autossh-tunnel-client tags: - autossh-tunnel-client-service-initd-update diff --git a/tasks/service-systemd.yml b/tasks/service-systemd.yml index aaa3325..fca93ad 100644 --- a/tasks/service-systemd.yml +++ b/tasks/service-systemd.yml @@ -6,7 +6,7 @@ dest: "{{ autossh_tunnel_client_etc_systemd_file }}" owner: root group: root - mode: 0644 + mode: '0644' register: _update_systemd_script notify: restart autossh-tunnel-client tags: diff --git a/tasks/service-upstart.yml b/tasks/service-upstart.yml index c770f7c..fb7e84b 100644 --- a/tasks/service-upstart.yml +++ b/tasks/service-upstart.yml @@ -6,7 +6,7 @@ dest: "{{ autossh_tunnel_client_etc_init_file }}" owner: root group: root - mode: 0644 + mode: '0644' notify: restart autossh-tunnel-client tags: - autossh-tunnel-client-service-upstart-update diff --git a/tests/tasks/pre.yml b/tests/tasks/pre.yml index d604cd1..0e63631 100644 --- a/tests/tasks/pre.yml +++ b/tests/tasks/pre.yml @@ -14,7 +14,7 @@ state: directory owner: root group: root - mode: 0700 + mode: '0700' - name: generate key pair ansible.builtin.command: > diff --git a/tests/test.yml b/tests/test.yml index 2790f3a..f1a2bcb 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: