Skip to content

Commit e727ab8

Browse files
authored
Merge pull request #11 from Oefenweb/more-flexibilty-for-docker
More flexibilty for docker
2 parents 10f593b + 26b0f46 commit e727ab8

File tree

13 files changed

+42
-37
lines changed

13 files changed

+42
-37
lines changed

.github/workflows/ci.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,11 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
include:
47-
- distro: debian8
48-
- distro: debian9
49-
- distro: debian10
50-
- distro: ubuntu1604
51-
ansible-version: '>=2.10, <2.11'
52-
- distro: ubuntu1604
5347
- distro: ubuntu1804
48+
ansible-version: '>=9, <10'
5449
- distro: ubuntu2004
50+
- distro: ubuntu2204
51+
- distro: ubuntu2404
5552

5653
steps:
5754
- name: Check out the codebase
@@ -65,8 +62,8 @@ jobs:
6562
python-version: '3.x'
6663

6764
- name: Install test dependencies
68-
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker
69-
65+
run: |
66+
pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker
7067
- name: Run Molecule tests
7168
run: |
7269
molecule test

Vagrantfile

+15-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
role = File.basename(File.expand_path(File.dirname(__FILE__)))
55

66
boxes = [
7-
{
8-
:name => "ubuntu-1604",
9-
:box => "bento/ubuntu-16.04",
10-
:ip => '10.0.0.12',
11-
:cpu => "50",
12-
:ram => "256"
13-
},
147
{
158
:name => "ubuntu-1804",
169
:box => "bento/ubuntu-18.04",
@@ -23,7 +16,21 @@ boxes = [
2316
:box => "bento/ubuntu-20.04",
2417
:ip => '10.0.0.14',
2518
:cpu => "50",
26-
:ram => "384"
19+
:ram => "512"
20+
},
21+
{
22+
:name => "ubuntu-2204",
23+
:box => "bento/ubuntu-22.04",
24+
:ip => '10.0.0.15',
25+
:cpu => "50",
26+
:ram => "512"
27+
},
28+
{
29+
:name => "ubuntu-2404",
30+
:box => "bento/ubuntu-24.04",
31+
:ip => '10.0.0.16',
32+
:cpu => "50",
33+
:ram => "512"
2734
},
2835
]
2936

handlers/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
ansible.builtin.service:
55
name: autossh-tunnel-client
66
state: restarted
7+
use: "{{ service_use_service_mgr | default(omit) }}"
78
when: service_default_state | default('started') == 'started'

meta/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ galaxy_info:
1010
platforms:
1111
- name: Ubuntu
1212
versions:
13-
- xenial
1413
- bionic
1514
- focal
15+
- jammy
16+
- noble
1617
galaxy_tags:
1718
- system
1819
- networking

molecule/default/collections.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
---
2-
collections:
3-
- name: community.docker
4-
version: '>=1.2.0,<2'
5-
- name: community.general
6-
version: '>=2,<3'
2+
collections: []

molecule/default/molecule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ driver:
55
name: docker
66
platforms:
77
- name: instance
8-
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
8+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
99
command: ${MOLECULE_DOCKER_COMMAND:-""}
1010
volumes:
1111
- /sys/fs/cgroup:/sys/fs/cgroup:rw

tasks/main.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,22 @@
2727
- autossh-tunnel-client-configure
2828

2929
- name: service
30-
block:
31-
- name: service-initd
32-
ansible.builtin.import_tasks: service-initd.yml
3330
when: is_docker_guest
3431
tags:
3532
- configuration
3633
- autossh-tunnel-client
3734
- autossh-tunnel-client-service
3835
- autossh-tunnel-client-service-initd
36+
block:
37+
- name: service-initd
38+
ansible.builtin.import_tasks: service-initd.yml
3939

4040
- name: service
41+
when: not is_docker_guest
42+
tags:
43+
- configuration
44+
- autossh-tunnel-client
45+
- autossh-tunnel-client-service
4146
block:
4247
- name: service upstart
4348
ansible.builtin.import_tasks: service-upstart.yml
@@ -50,17 +55,13 @@
5055
when: ansible_service_mgr == 'systemd'
5156
tags:
5257
- autossh-tunnel-client-service-systemd
53-
when: not is_docker_guest
54-
tags:
55-
- configuration
56-
- autossh-tunnel-client
57-
- autossh-tunnel-client-service
5858

5959
- name: start and enable service
6060
ansible.builtin.service:
6161
name: autossh-tunnel-client
6262
state: "{{ service_default_state | default('started') }}"
6363
enabled: "{{ service_default_enabled | default(true) | bool }}"
64+
use: "{{ service_use_service_mgr | default(omit) }}"
6465
tags:
6566
- configuration
6667
- autossh-tunnel-client

tasks/service-initd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dest: "{{ autossh_tunnel_client_etc_init_d_file }}"
77
owner: root
88
group: root
9-
mode: 0755
9+
mode: '0755'
1010
notify: restart autossh-tunnel-client
1111
tags:
1212
- autossh-tunnel-client-service-initd-update

tasks/service-systemd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dest: "{{ autossh_tunnel_client_etc_systemd_file }}"
77
owner: root
88
group: root
9-
mode: 0644
9+
mode: '0644'
1010
register: _update_systemd_script
1111
notify: restart autossh-tunnel-client
1212
tags:

tasks/service-upstart.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
dest: "{{ autossh_tunnel_client_etc_init_file }}"
77
owner: root
88
group: root
9-
mode: 0644
9+
mode: '0644'
1010
notify: restart autossh-tunnel-client
1111
tags:
1212
- autossh-tunnel-client-service-upstart-update

tests/tasks/pre.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
state: directory
1515
owner: root
1616
group: root
17-
mode: 0700
17+
mode: '0700'
1818

1919
- name: generate key pair
2020
ansible.builtin.command: >

tests/test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# test file
22
---
3-
- hosts: localhost
3+
- name: converge
4+
hosts: localhost
45
connection: local
56
become: true
67
pre_tasks:

tests/vagrant.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# test file
22
---
3-
- hosts: all
3+
- name: converge
4+
hosts: all
45
remote_user: vagrant
56
become: true
67
pre_tasks:

0 commit comments

Comments
 (0)