├── .config └── ansible-lint.yml ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .yamllint.yaml ├── LICENSE ├── README.md ├── defaults └── main.yml ├── meta ├── main.yml └── requirements.yml ├── platform-matrix-v1.json ├── tasks └── main.yml ├── test.yml └── vars └── main.yml /.config/ansible-lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | skip_list: 3 | - 'name[template]' 4 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | --- 2 | jobs: 3 | bake-ansible-images-v1: 4 | uses: andrewrothstein/.github/.github/workflows/bake-ansible-images-v1.yml@develop 5 | 'on': push 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **~*.retry 2 | Dockerfile.* 3 | requirements.yml 4 | !meta/requirements.yml 5 | **/*undo-tree* 6 | .ansible -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | - repo: https://github.com/pre-commit/pre-commit-hooks 2 | sha: v0.8.0 3 | hooks: 4 | - id: trailing-whitespace 5 | - id: end-of-file-fixer 6 | - id: check-json 7 | - id: check-yaml 8 | - id: check-symlinks 9 | - id: detect-aws-credentials 10 | args: 11 | - --allow-missing-credentials 12 | - id: check-added-large-files 13 | - id: detect-private-key 14 | 15 | - repo: https://github.com/willthames/ansible-lint.git 16 | sha: v3.4.13 17 | hooks: 18 | - id: ansible-lint 19 | files: \.(yaml|yml)$ 20 | args: [ 21 | "--exclude=roles", 22 | "--exclude=basic/roles", 23 | "--exclude=.travis.yml" 24 | ] 25 | -------------------------------------------------------------------------------- /.yamllint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | rules: 3 | line-length: disable 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Rothstein 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | andrewrothstein.terraform 2 | =========================== 3 | ![Build Status](https://github.com/andrewrothstein/ansible-terraform/actions/workflows/build.yml/badge.svg) 4 | 5 | Installs [Terraform](https://www.terraform.io/) 6 | 7 | Requirements 8 | ------------ 9 | 10 | See [meta/main.yml](meta/main.yml) 11 | 12 | Role Variables 13 | -------------- 14 | 15 | See [defaults/main.yml](defaults/main.yml) 16 | 17 | Dependencies 18 | ------------ 19 | 20 | See [meta/main.yml](meta/main.yml) 21 | 22 | Example Playbook 23 | ---------------- 24 | 25 | ```yml 26 | - hosts: servers 27 | roles: 28 | - andrewrothstein.terraform 29 | ``` 30 | 31 | License 32 | ------- 33 | 34 | MIT 35 | 36 | Author Information 37 | ------------------ 38 | 39 | Andrew Rothstein 40 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | terraform_ver: 1.11.3 3 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Andrew Rothstein 4 | company: BlackRock 5 | description: terraform role 6 | galaxy_tags: 7 | - terraform 8 | - cloud 9 | - infrastructure 10 | license: MIT 11 | min_ansible_version: '1.2' 12 | namespace: andrewrothstein 13 | platforms: 14 | - name: Alpine 15 | versions: 16 | - all 17 | - name: ArchLinux 18 | versions: 19 | - all 20 | - name: Debian 21 | versions: 22 | - bookworm 23 | - bullseye 24 | - name: EL 25 | versions: 26 | - '8' 27 | - '9' 28 | - name: Fedora 29 | versions: 30 | - '40' 31 | - '41' 32 | - name: Ubuntu 33 | versions: 34 | - jammy 35 | - noble 36 | role_name: terraform 37 | -------------------------------------------------------------------------------- /meta/requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: andrewrothstein.hashi 3 | version: v1.0.18 4 | -------------------------------------------------------------------------------- /platform-matrix-v1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "OS": "alpine", 4 | "OS_VER": "3.20" 5 | }, 6 | { 7 | "OS": "alpine", 8 | "OS_VER": "3.21" 9 | }, 10 | { 11 | "OS": "alpine", 12 | "OS_VER": "edge" 13 | }, 14 | { 15 | "OS": "archlinux", 16 | "OS_VER": "latest" 17 | }, 18 | { 19 | "OS": "debian", 20 | "OS_VER": "bookworm" 21 | }, 22 | { 23 | "OS": "debian", 24 | "OS_VER": "bullseye" 25 | }, 26 | { 27 | "OS": "fedora", 28 | "OS_VER": "40" 29 | }, 30 | { 31 | "OS": "fedora", 32 | "OS_VER": "41" 33 | }, 34 | { 35 | "OS": "rockylinux", 36 | "OS_VER": "8" 37 | }, 38 | { 39 | "OS": "rockylinux", 40 | "OS_VER": "9" 41 | }, 42 | { 43 | "OS": "ubuntu", 44 | "OS_VER": "jammy" 45 | }, 46 | { 47 | "OS": "ubuntu", 48 | "OS_VER": "noble" 49 | } 50 | ] -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Installing terraform binaries 3 | ansible.builtin.include_role: 4 | name: andrewrothstein.hashi 5 | vars: 6 | hashi_apps: 7 | - name: '{{ terraform_app.name | default("terraform") }}' 8 | ver: '{{ terraform_app.ver | default(terraform_ver) }}' 9 | meta: '{{ terraform_app.meta | default("") }}' 10 | -------------------------------------------------------------------------------- /test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Testing andrewrothstein.terraform 3 | hosts: all 4 | tasks: 5 | - name: Installing andrewrothstein.terraform 6 | ansible.builtin.include_role: 7 | name: '{{ playbook_dir }}' 8 | - name: Executing 'terraform --version' 9 | ansible.builtin.command: /usr/local/bin/terraform --version 10 | changed_when: false 11 | register: terraform_test_output 12 | - name: Output from 'terraform --version' 13 | ansible.builtin.debug: 14 | msg: '{{ terraform_test_output.stdout }}' 15 | -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | --------------------------------------------------------------------------------