Skip to content

Commit 6621121

Browse files
authored
Merge pull request #4 from Oefenweb/consistency-changes
Consistency changes
2 parents d065ff1 + 4806916 commit 6621121

File tree

9 files changed

+33
-24
lines changed

9 files changed

+33
-24
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
python-version: '3.x'
2424

2525
- name: Install test dependencies
26-
run: pip install ansible-lint[community,yamllint]
26+
run: |
27+
pip install ansible-lint
28+
ansible-galaxy install -r requirements.yml
2729
2830
- name: Lint code
2931
run: |
@@ -43,11 +45,8 @@ jobs:
4345
matrix:
4446
include:
4547
- distro: debian8
46-
ansible-version: '<2.10'
4748
- distro: debian9
4849
- distro: debian10
49-
- distro: ubuntu1604
50-
ansible-version: '>=2.9, <2.10'
5150
- distro: ubuntu1604
5251
ansible-version: '>=2.10, <2.11'
5352
- distro: ubuntu1604

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:18.04
22
MAINTAINER Mischa ter Smitten <[email protected]>
33

4+
ENV LANG C.UTF-8
5+
ENV LC_ALL C.UTF-8
6+
47
# python
58
RUN apt-get update && \
6-
DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-dev curl && \
9+
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-minimal python3-dev curl && \
710
apt-get clean
8-
RUN curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python -
11+
RUN curl -sL https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3 -
912
RUN rm -rf $HOME/.cache
1013

1114
# ansible
12-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \
15+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-apt && \
1316
apt-get clean
14-
RUN pip install ansible==2.9.15
17+
RUN pip3 install ansible==2.10.7
1518
RUN rm -rf $HOME/.cache
1619

1720
# provision

meta/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# meta file
22
---
33
galaxy_info:
4-
namespace: oefenweb
4+
author: oefenweb
55
role_name: autossh_tunnel_server
6-
author: Mischa ter Smitten
76
company: Oefenweb.nl B.V.
87
description: Set up a persistent tunnel (using autossh) in Debian-like systems (server side)
98
license: MIT
10-
min_ansible_version: 2.9.0
9+
min_ansible_version: 2.10.0
1110
platforms:
1211
- name: Ubuntu
1312
versions:

molecule/default/collections.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
collections:
3+
- name: community.docker
4+
version: '>=1.2.0,<2'
5+
- name: community.general
6+
version: '>=2,<3'

requirements.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# requirements file
2+
---
3+
collections:
4+
- name: ansible.posix

tasks/main.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# tasks file
22
---
33
- name: add group
4-
group:
4+
ansible.builtin.group:
55
name: "{{ item }}"
66
system: true
7-
with_flattened:
8-
- "{{ autossh_tunnel_server_group }}"
9-
- "{{ autossh_tunnel_server_groups }}"
7+
with_items: "{{ [autossh_tunnel_server_group] + autossh_tunnel_server_groups }}"
108
tags:
119
- configuration
1210
- autossh-tunnel-server
1311
- autossh-tunnel-server-add-group
1412

1513
- name: add user
16-
user:
14+
ansible.builtin.user:
1715
name: "{{ autossh_tunnel_server_user }}"
1816
system: true
1917
group: "{{ autossh_tunnel_server_group }}"
@@ -25,7 +23,7 @@
2523
- autossh-tunnel-server-add-user
2624

2725
- name: create authorized_keys from public key
28-
authorized_key:
26+
ansible.posix.authorized_key:
2927
user: "{{ autossh_tunnel_server_user }}"
3028
key: "{{ lookup('file', item.src) }}"
3129
state: "{{ item.state | default('present') }}"

tests/tasks/pre.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# pre test file
22
---
33
- name: install dependencies
4-
apt:
4+
ansible.builtin.apt:
55
name:
66
- openssh-client
77
state: "{{ apt_install_state | default('latest') }}"
88
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
99

1010
- name: generate ssh key
11-
command: >
11+
ansible.builtin.command: >
1212
ssh-keygen -t rsa -b 2048 -C '' -P '' -f {{ autossh_tunnel_server_private_key_file }} -q
1313
args:
1414
creates: "{{ autossh_tunnel_server_private_key_file }}"

tests/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
become: true
66
pre_tasks:
77
- name: include vars
8-
include_vars: "{{ playbook_dir }}/vars/main.yml"
8+
ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml"
99
- name: include tasks
10-
include: "{{ playbook_dir }}/tasks/pre.yml"
10+
ansible.builtin.include: "{{ playbook_dir }}/tasks/pre.yml"
1111
roles:
1212
- ../../

tests/vagrant.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
become: true
66
pre_tasks:
77
- name: include vars
8-
include_vars: "{{ playbook_dir }}/vars/main.yml"
8+
ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml"
99
- name: include tasks
10-
include: "{{ playbook_dir }}/tasks/pre.yml"
10+
ansible.builtin.include: "{{ playbook_dir }}/tasks/pre.yml"
1111
roles:
1212
- ../../

0 commit comments

Comments
 (0)