Created
March 30, 2022 22:15
-
-
Save dacbd/327db61591a971a331ade2c7d5785c16 to your computer and use it in GitHub Desktop.
Install terraform of server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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