Skip to content

Instantly share code, notes, and snippets.

@dacbd
Created March 30, 2022 22:15
Show Gist options
  • Save dacbd/327db61591a971a331ade2c7d5785c16 to your computer and use it in GitHub Desktop.
Save dacbd/327db61591a971a331ade2c7d5785c16 to your computer and use it in GitHub Desktop.
Install terraform of server
---
- name: install terraform
hosts: all
become: true
tasks:
- name: Terraform deps
apt:
update_cache: true
state: present
pkg:
- gnupg
- software-properties-common
- name: Add Terraform apt key
ansible.builtin.apt_key:
url: https://apt.releases.hashicorp.com/gpg
keyring: /usr/share/keyrings/terraform.gpg
state: present
- name: Add Terraform apt repository
ansible.builtin.apt_repository:
repo: deb [signed-by=/usr/share/keyrings/terraform.gpg] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main
state: present
- name: Install Terraform
apt:
update_cache: true
state: present
pkg: terraform
#!/bin/bash
ansible-playbook -u ubuntu -i "10.248.104.54," ./playbook.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment