File tree Expand file tree Collapse file tree 5 files changed +29
-36
lines changed Expand file tree Collapse file tree 5 files changed +29
-36
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : all
3+ become : yes
4+ become_user : root
5+ tasks :
6+ - name : Stop firewalld
7+ service : name=firewalld state=stopped
8+ - name : Install the httpd package
9+ yum : name=httpd
10+ - name : Start the httpd service
11+ service : name=httpd state=started
12+ - name : Configure Cat App
13+ script : ../files/webapp.sh
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -109,23 +109,20 @@ resource "azurerm_virtual_machine" "site" {
109109 }
110110 }
111111
112-
113-
114112 # This is to ensure SSH comes up before we run the local exec.
115- provisioner "remote-exec" {
113+ provisioner "remote-exec" {
116114 inline = [" echo 'Hello World'" ]
117115
118116 connection {
119117 type = " ssh"
120- host = " ${ azurerm_public_ip . tf-ansible-pip . ip_address } "
118+ host = " ${ azurerm_public_ip . tf-ansible-pip . fqdn } "
121119 user = " ${ var . admin_username } "
122120 private_key = " ${ var . ssh_key } "
123121 }
124122 }
125123
126- # TODO: have Dylan help with apache.yml playbook
127124 provisioner "local-exec" {
128- command = " ansible-playbook -i '${ azurerm_public_ip . tf-ansible-pip . ip_address } ,' --private-key ${ var . ssh_key } httpd.yml"
125+ command = " ansible-playbook -i '${ azurerm_public_ip . tf-ansible-pip . fqdn } ,' --private-key ${ var . ssh_key_path } ../ansible/ httpd.yml"
129126 }
130127
131128}
Original file line number Diff line number Diff line change 66# and include any data from the state file. Outputs are sorted alphabetically;
77# use an underscore _ to move things to the bottom.
88
9- # output "_instructions" {
10- # value = "This output contains plain text. You can add variables too."
11- # }
9+ output "_instructions" {
10+ value = " This output contains plain text. You can add variables too."
11+ }
1212
13- # output "public_dns" {
14- # value = "${azurerm_public_ip.tf-ansible-pip.fqdn}"
15- # }
13+ output "public_dns" {
14+ value = " ${ azurerm_public_ip . tf-ansible-pip . fqdn } "
15+ }
1616
17- # output "App_Server_URL" {
18- # value = "http://${azurerm_public_ip.tf-ansible-pip.fqdn}"
19- # }
17+ output "App_Server_URL" {
18+ value = " http://${ azurerm_public_ip . tf-ansible-pip . fqdn } "
19+ }
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ variable "ssh_key" {
99 description = " SSH key for connecting to our Red Hat instance"
1010}
1111
12+ variable "ssh_key_path" {
13+ description = " Path to your ssh key on the local system."
14+ }
15+
1216variable "ssh_pubkey" {
1317 description = " Public half of SSH key for connecting to our Red Hat instance."
1418}
You can’t perform that action at this time.
0 commit comments