Skip to content

Commit 26f836b

Browse files
authored
Merge pull request #17 from dhoeric/chore/use-github-action
Add GPG key
2 parents d3c3da1 + 997f55e commit 26f836b

File tree

10 files changed

+226
-58
lines changed

10 files changed

+226
-58
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: CI
3+
'on':
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "30 5 * * 0"
10+
11+
defaults:
12+
run:
13+
working-directory: 'dhoeric.aws-ssm'
14+
15+
jobs:
16+
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out the codebase.
22+
uses: actions/checkout@v2
23+
with:
24+
path: 'dhoeric.aws-ssm'
25+
26+
- name: Set up Python 3.
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.x'
30+
31+
- name: Install test dependencies.
32+
run: pip3 install yamllint ansible
33+
34+
- name: Lint code.
35+
run: |
36+
yamllint .
37+
38+
molecule:
39+
name: Molecule
40+
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
include:
44+
- distro: centos8
45+
playbook: converge.yml
46+
- distro: fedora32
47+
playbook: converge.yml
48+
- distro: ubuntu2004
49+
playbook: converge.yml
50+
- distro: ubuntu1804
51+
playbook: converge.yml
52+
- distro: debian10
53+
playbook: converge.yml
54+
55+
steps:
56+
- name: Check out the codebase.
57+
uses: actions/checkout@v2
58+
with:
59+
path: 'dhoeric.aws-ssm'
60+
61+
- name: Set up Python 3.
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: '3.x'
65+
66+
- name: Install test dependencies.
67+
run: pip3 install ansible molecule[docker] docker
68+
69+
- name: Run Molecule tests.
70+
run: molecule test
71+
env:
72+
PY_COLORS: '1'
73+
ANSIBLE_FORCE_COLOR: '1'
74+
MOLECULE_DISTRO: ${{ matrix.distro }}
75+
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
3+
# repository or organization.
4+
#
5+
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
6+
# See: https://github.com/ansible/galaxy/issues/46
7+
8+
name: Release
9+
'on':
10+
push:
11+
tags:
12+
- '*'
13+
14+
defaults:
15+
run:
16+
working-directory: 'dhoeric.aws-ssm'
17+
18+
jobs:
19+
20+
release:
21+
name: Release
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out the codebase.
25+
uses: actions/checkout@v2
26+
with:
27+
path: 'dhoeric.aws-ssm'
28+
29+
- name: Set up Python 3.
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: '3.x'
33+
34+
- name: Install Ansible.
35+
run: pip3 install ansible-base
36+
37+
- name: Trigger a new import on Galaxy.
38+
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.yamllint

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length:
6+
max: 120
7+
level: warning
8+
9+
ignore: |
10+
.github/stale.yml

defaults/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# defaults file for aws-ssm
33
url: 'amd64'
4-
#aws_ssm_activation_code:
5-
#aws_ssm_activation_id:
6-
#aws_ssm_ec2_region: "{{ec2_region}}"
4+
# aws_ssm_activation_code:
5+
# aws_ssm_activation_id:
6+
# aws_ssm_ec2_region: "{{ec2_region}}"

files/amazon-ssm-agent.gpg

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
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mDn8JmREypkfUS+vAONlmsuFJUjXipa5cAP4YjPMTW7HNxC/WrLV6NSuQZ
20+
5nweVeXAQPxjOoNaAOOk1hlUuGdypPxCNV6NYLm5W7jz1buDYOhNwPvVP63wy1BK
21+
ME4HzE94ggCxnXdafJU2KR11Mj/9LRFeDJ8X8huSKOFNOy2IotuW5VmxlDvbkvDT
22+
ceelqWJjh5CsWKmWActoxqtyiedQqxgsxFuwqVIWxP758C3NP1zpxvr8SXxdJBy3
23+
8U4iHC3I89zlX4x4tPiMn3vQOq+RhnZEzEphrmPkQAaq6H160hHxQz44DoM8jDIn
24+
f/EbWKPkw+p5679JUrXIZDOYP2OlbKoAY4axfCwvjIqAQ5KWFQyKmWyoRwTl4IrC
25+
bAXqljtqzyF20g2puNpxpvxT8CF+YaKYPKqXAbZkBQoOoPBbEGGG19BX5rCBehTx
26+
QwBAgmmk7FG162TY2uivbwjmguh4DM4PgEoHtsgg9UVM+A+M5tIuEeTC5jWgzEcf
27+
VkwTY6N+3XNvAnYNobND8mvN+QAJG7NpryX1fNBaxGsze3QBL42v/zFmG6VSfINp
28+
4H01UHp8Pmidk8axmi+w6hoqB+uDo3lgd6U=
29+
=c8Y2
30+
-----END PGP PUBLIC KEY BLOCK-----

meta/main.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ galaxy_info:
3131
# platform on this list, let us know and we'll get it added!
3232
#
3333
platforms:
34-
- name: EL
35-
versions:
36-
- all
34+
- name: EL
35+
versions:
36+
- all
3737
# - 5
3838
# - 6
3939
# - 7
@@ -84,9 +84,9 @@ galaxy_info:
8484
# versions:
8585
# - all
8686
# - 2012R2
87-
- name: Amazon
88-
versions:
89-
- all
87+
- name: Amazon
88+
versions:
89+
- all
9090
# - 2013.03
9191
# - 2013.09
9292
#- name: GenericBSD
@@ -113,8 +113,8 @@ galaxy_info:
113113
# - 9.1
114114
# - 9.2
115115
# - 9.3
116-
- name: Ubuntu
117-
versions:
116+
- name: Ubuntu
117+
versions:
118118
# - all
119119
# - lucid
120120
# - maverick
@@ -124,11 +124,11 @@ galaxy_info:
124124
# - quantal
125125
# - raring
126126
# - saucy
127-
- trusty
127+
- trusty
128128
# - utopic
129129
# - vivid
130130
# - wily
131-
- xenial
131+
- xenial
132132
#- name: SLES
133133
# versions:
134134
# - all
@@ -146,11 +146,11 @@ galaxy_info:
146146
# versions:
147147
# - all
148148
# - any
149-
- name: Debian
150-
versions:
149+
- name: Debian
150+
versions:
151151
# - all
152152
# - etch
153-
- jessie
153+
- jessie
154154
# - lenny
155155
# - sid
156156
# - squeeze

molecule/default/converge.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
become: true
5+
6+
pre_tasks:
7+
- name: Update apt cache.
8+
apt: update_cache=true cache_valid_time=300
9+
when: ansible_os_family == 'Debian'
10+
11+
roles:
12+
- role: dhoeric.aws-ssm

molecule/default/molecule.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: docker
6+
platforms:
7+
- name: instance
8+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
9+
command: ${MOLECULE_DOCKER_COMMAND:-""}
10+
volumes:
11+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
12+
privileged: true
13+
pre_build_image: true
14+
provisioner:
15+
name: ansible
16+
playbooks:
17+
converge: ${MOLECULE_PLAYBOOK:-converge.yml}

tasks/main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@
1111
url: '386'
1212
when: cpu_arch.stdout == '32'
1313

14+
- name: Install pre-required packages
15+
become: yes
16+
become_user: root
17+
package:
18+
name: gnupg
19+
state: present
20+
21+
- name: Copy GPG key
22+
copy:
23+
src: amazon-ssm-agent.gpg
24+
dest: /tmp/amazon-ssm-agent.gpg
25+
26+
- name: Import GPG key for Redhat Family (Amazon Linux, RHEL, and CentOS) 32/64-bit
27+
become: yes
28+
become_user: root
29+
rpm_key:
30+
key: /tmp/amazon-ssm-agent.gpg
31+
state: present
32+
when: ansible_os_family == 'RedHat'
33+
1434
- name: Install rpm file for Redhat Family (Amazon Linux, RHEL, and CentOS) 32/64-bit
1535
become: yes
1636
become_user: root
@@ -19,6 +39,14 @@
1939
state: present
2040
when: ansible_os_family == 'RedHat'
2141

42+
- name: Import GPG key for Debian family 32/64-bit
43+
become: yes
44+
become_user: root
45+
apt_key:
46+
file: /tmp/amazon-ssm-agent.gpg
47+
state: present
48+
when: ansible_os_family == 'Debian'
49+
2250
- name: Install deb file for Debian family 32/64-bit
2351
become: yes
2452
become_user: root

0 commit comments

Comments
 (0)