Skip to content

Commit fb7832c

Browse files
s2504sconst-bon
authored andcommitted
Exclude Ansible provisioner (#16)
1 parent 336dd68 commit fb7832c

File tree

3 files changed

+2
-40
lines changed

3 files changed

+2
-40
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ Include this repository as a module in your existing terraform code:
1111
```terraform
1212
module "admin_tier" {
1313
source = "git::https://github.com/cloudposse/terraform-aws-ec2-instance.git?ref=master"
14-
ansible_playbook = "${var.ansible_playbook}"
15-
ansible_arguments = "${var.ansible_arguments}"
16-
ansible_envs = "${var.ansible_envs}"
17-
ansible_dry_run = "${var.ansible_dry_run}"
1814
ssh_key_pair = "${var.ssh_key_pair}"
1915
github_api_token = "${var.github_api_token}"
2016
github_organization = "${var.github_organization}"
@@ -36,7 +32,6 @@ This module depends on these modules:
3632

3733
* [terraform-null-label](https://github.com/cloudposse/terraform-null-label)
3834
* [tf_github_authorized_keys](https://github.com/cloudposse/tf_github_authorized_keys)
39-
* [terraform-null-ansible](https://github.com/cloudposse/terraform-null-ansible)
4035

4136
It is necessary to run `terraform get` to download those modules.
4237

@@ -64,10 +59,6 @@ resource "aws_ami_from_instance" "example" {
6459
| `github_api_token` | `` | GitHub API token | Yes |
6560
| `github_organization` | `` | GitHub organization name | Yes |
6661
| `github_team` | `` | GitHub team | Yes |
67-
| `ansible_playbook` | `` | Path to the playbook - required for `tf_ansible` (e.g. `./admin_tier.yml`) | Yes |
68-
| `ansible_arguments` | [] | List of ansible arguments (e.g. `["--user=ubuntu"]`) | No |
69-
| `ansible_envs` | [] | List of ansible envs (e.g. `["ansible_ssh_pass=${var.ansible_ssh_password}"]`) | No |
70-
| `ansible_dry_run` | `false` | The Ansible run without changes | No |
7162
| `instance_type` | `t2.micro` | The type of the creating instance (e.g. `t2.micro`) | No |
7263
| `vpc_id` | `` | The id of the VPC that the creating instance security group belongs to | Yes |
7364
| `security_groups` | [] | List of Security Group IDs allowed to connect to creating instance | Yes |

main.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Using tf_ansible module
2-
31
data "aws_iam_policy_document" "default" {
42
statement {
53
sid = ""
@@ -123,15 +121,6 @@ resource "aws_eip" "default" {
123121
vpc = true
124122
}
125123

126-
# Apply the provisioner module for this resource
127-
module "ansible" {
128-
source = "git::https://github.com/cloudposse/terraform-null-ansible.git?ref=tags/0.3.9"
129-
arguments = "${var.ansible_arguments}"
130-
envs = "${compact(concat(var.ansible_envs, list("host=${var.associate_public_ip_address ? join("", aws_eip.default.*.public_ip) : join("", aws_instance.default.*.private_ip)}")))}"
131-
playbook = "${var.ansible_playbook}"
132-
dry_run = "${var.ansible_dry_run}"
133-
}
134-
135124
# Restart dead or hung instance
136125
data "aws_region" "default" {
137126
current = true

variables.tf

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,10 @@ variable "github_organization" {}
66

77
variable "github_team" {}
88

9-
variable "ansible_playbook" {
10-
default = ""
11-
}
12-
139
variable "associate_public_ip_address" {
1410
default = true
1511
}
1612

17-
variable "ansible_arguments" {
18-
type = "list"
19-
default = []
20-
}
21-
22-
variable "ansible_envs" {
23-
type = "list"
24-
default = []
25-
}
26-
27-
variable "ansible_dry_run" {
28-
default = false
29-
}
30-
3113
variable "instance_type" {
3214
default = "t2.micro"
3315
}
@@ -121,10 +103,10 @@ variable "default_alarm_action" {
121103

122104
variable "create_default_security_group" {
123105
description = "Create default Security Group with Egress traffic allowed only"
124-
default = true
106+
default = "true"
125107
}
126108

127109
variable "instance_enabled" {
128110
description = "Flag for creating an instance. Set to false if it is necessary to skip instance creation"
129-
default = true
111+
default = "true"
130112
}

0 commit comments

Comments
 (0)