This repository was archived by the owner on Oct 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +208
-39
lines changed Expand file tree Collapse file tree 14 files changed +208
-39
lines changed Original file line number Diff line number Diff line change 11
11
- master
12
12
13
13
jobs :
14
- test :
14
+ test_default :
15
+ runs-on : ubuntu-latest
16
+ strategy :
17
+ fail-fast : false
18
+ matrix :
19
+ distro :
20
+ - ubuntu2004
21
+ - ubuntu1804
22
+ # - centos7
23
+ # - centos8
24
+ - debian10
25
+ - debian11
26
+ - fedora35
27
+ # - amazonlinux2
28
+ steps :
29
+ - name : checkout the repository
30
+ uses : actions/checkout@v2
31
+ with :
32
+ path : " ${{ github.repository }}"
33
+
34
+ - name : run molecule (default scenario)
35
+ uses :
robertdebock/[email protected]
36
+ with :
37
+ command : " test"
38
+ env :
39
+ MOLECULE_DISTRO : ${{ matrix.distro }}
40
+
41
+ test_versioned :
42
+ needs :
43
+ - test_default
15
44
runs-on : ubuntu-latest
16
45
strategy :
17
46
fail-fast : false
18
47
matrix :
19
48
distro :
20
49
- ubuntu2004
21
50
- ubuntu1804
22
- - ubuntu1604
23
51
- centos7
24
52
- centos8
25
- - debian9
26
53
- debian10
27
- - fedora29
54
+ - debian11
55
+ - fedora35
56
+ - amazonlinux2
28
57
steps :
29
58
- name : checkout the repository
30
59
uses : actions/checkout@v2
31
60
with :
32
61
path : " ${{ github.repository }}"
33
62
34
- - name : run molecule
35
- uses :
robertdebock/[email protected]
63
+ - name : run molecule (versioned scenario)
64
+ uses :
robertdebock/[email protected]
65
+ with :
66
+ scenario : versioned
67
+ command : " test"
36
68
env :
37
69
MOLECULE_DISTRO : ${{ matrix.distro }}
38
70
39
71
deploy :
40
72
needs :
41
- - test
73
+ - test_default
74
+ - test_versioned
42
75
runs-on : ubuntu-latest
43
76
steps :
44
77
- name : to Ansible Galaxy
Original file line number Diff line number Diff line change @@ -15,13 +15,12 @@ Role Variables
15
15
16
16
These variables are defined in [ defaults/main.yml] ( ./defaults/main.yml ) :
17
17
18
- terraform_architecture: 'amd64' # enum, one of 386|amd64|arm
18
+ terraform_plugin_urls: []
19
19
20
- terraform_version: '0.12.24'
20
+ Additionally, it is possible to define an explicit version to be downloaded and installed:
21
21
22
- terraform_binary_dir_path: "/usr/local/bin"
22
+ terraform_version: '0.12.24'
23
23
24
- terraform_plugin_urls: []
25
24
26
25
Dependencies
27
26
------------
31
30
Example Playbook
32
31
----------------
33
32
33
+ To get a default package:
34
+
35
+ - name: Converge
36
+ hosts: all
37
+ roles:
38
+ - role: terraform
39
+
40
+
41
+ To get an explicit version:
42
+
34
43
- name: Converge
35
44
hosts: all
36
45
vars:
Original file line number Diff line number Diff line change 1
1
---
2
2
3
- terraform_architecture : ' amd64' # enum, one of 386|amd64|arm
4
-
5
- terraform_version : ' 0.12.24'
6
-
7
- terraform_binary_dir_path : " /usr/local/bin"
8
-
9
3
terraform_plugin_urls : []
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ galaxy_info:
24
24
- all
25
25
- name : EL
26
26
versions :
27
- - 7
27
+ - all
28
28
29
29
galaxy_tags :
30
30
- terraform
Original file line number Diff line number Diff line change 2
2
3
3
- name : Converge
4
4
hosts : all
5
- vars :
6
- version : ' 0.12.24'
7
5
roles :
8
6
- role : ansible-role-terraform
9
7
vars :
10
- terraform_version : " {{ version }}"
11
- terraform_binary_dir_path : /usr/bin
12
8
terraform_plugin_urls :
13
9
- https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.6.11/terraform-provider-libvirt_0.6.11_linux_amd64.zip
14
-
15
- post_tasks :
16
- - name : terraform should be installed
17
- block :
18
- - name : check terraform version
19
- command : ' /usr/bin/terraform --version'
20
- changed_when : false
21
- register : r
22
- - name : evaluate file presence
23
- assert :
24
- that : version in r.stdout
25
- fail_msg : " terraform should be installed with a correct version"
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Verify
4
+ hosts : all
5
+ tasks :
6
+ - name : terraform should be installed
7
+ block :
8
+ - name : check terraform version
9
+ command : ' /usr/bin/terraform --version'
10
+ changed_when : false
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Converge
4
+ hosts : all
5
+ vars :
6
+ version : ' 0.12.24'
7
+ roles :
8
+ - role : ansible-role-terraform
9
+ vars :
10
+ terraform_version : " {{ version }}"
11
+ terraform_binary_dir_path : /usr/bin
12
+ terraform_plugin_urls :
13
+ - https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.6.11/terraform-provider-libvirt_0.6.11_linux_amd64.zip
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ dependency :
4
+ name : galaxy
5
+ driver :
6
+ name : docker
7
+ lint : |
8
+ set -e
9
+ yamllint -c .yamllint .
10
+ ansible-lint
11
+ platforms :
12
+ - name : instance
13
+ image : " geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
14
+ command : ${MOLECULE_DOCKER_COMMAND:-""}
15
+ volumes :
16
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
17
+ privileged : true
18
+ pre_build_image : true
19
+ provisioner :
20
+ name : ansible
21
+ verifier :
22
+ name : ansible
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Converge
3
+ hosts : all
4
+ tasks :
5
+ - name : update apt repository
6
+ when : " ansible_pkg_mgr == 'apt'"
7
+ apt :
8
+ update_cache : true
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Verify
4
+ hosts : all
5
+ vars :
6
+ version : ' 0.12.24'
7
+ tasks :
8
+ - name : terraform should be installed
9
+ block :
10
+ - name : check terraform version
11
+ command : ' terraform --version'
12
+ changed_when : false
13
+ register : r
14
+ failed_when : not version in r.stdout
You can’t perform that action at this time.
0 commit comments