Skip to content

Commit

Permalink
Migrate to CircleCI 2.0 because version 1 is not supported anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
migibert committed Aug 27, 2019
1 parent 6e113c9 commit 8e47c20
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 38 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2

jobs:
build:
environment:
TEST_DIR: terraform-role/tests

machine:
image: ubuntu-1604:201903-01

steps:
- checkout
- run: cp -r tests ~/tests
- run: mkdir ~/tests/roles
- run: sudo ln -s $(pwd) ~/tests/roles/migibert.terraform
- run: sudo pip install ansible
- run:
command: ansible-playbook --syntax-check -i inventory example.yml
working_directory: ~/tests
- run:
command: ansible-playbook --list-tasks -i inventory example.yml
working_directory: ~/tests
- run:
command: sudo ansible-playbook --connection=local -i inventory example.yml
working_directory: ~/tests
- run:
command: "sudo ansible-playbook --connection=local -i inventory example.yml | grep -q 'changed=0.*failed=0'"
working_directory: ~/tests
19 changes: 0 additions & 19 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# defaults file for terraform-role
terraform_version: 0.6.11
terraform_version: 0.12.7
terraform_dir: /opt/terraform
terraform_user: terraform
terraform_user_password: $6$uoCgixKJL4cFyIT$U7FisaA6GAdosBpGde.4NS00vaAg4tGmR63eBQQMsd8LiHUjetq6HDXG10719JwbNmQUSLzvG6zq8DOVOggIw1
25 changes: 15 additions & 10 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ galaxy_info:
license: MIT
min_ansible_version: 2.0
platforms:
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
- name: EL
versions:
- all
- name: Fedora
versions:
- all
- name: Debian
versions:
- all
- name: Ubuntu
versions:
- all
- name: GenericUNIX
versions:
- all
categories:
- cloud
dependencies: []
galaxy_tags:
- terraform
- infrastructure
- hashicorp
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
register: terraform_directory

- name: Check terraform version
shell: "terraform --version 2>&1 | head -n 1 | grep {{terraform_version}}"
shell: "terraform version 2>&1 | head -n 1 | grep -q {{terraform_version}}"
failed_when: false
changed_when: false
register: terraform_versions_match
Expand All @@ -31,7 +31,7 @@
src: /tmp/terraform-{{terraform_version}}.zip
dest: "{{terraform_dir}}"
copy: no
when: terraform_versions_match.rc != 0 or terraform_directory | changed
when: terraform_versions_match.rc != 0 or terraform_directory is changed

- name: Make terraform_user terraform directory owner
file:
Expand Down
5 changes: 0 additions & 5 deletions tests/ansible.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion tests/example.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- hosts: localhost

vars:
terraform_version: 0.6.11
terraform_version: 0.12.7
terraform_dir: /opt

roles:
Expand Down

0 comments on commit 8e47c20

Please sign in to comment.