File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : apache 
3+   tasks :
4+     - name : run  
Original file line number Diff line number Diff line change @@ -102,9 +102,14 @@ resource "azurerm_virtual_machine" "site" {
102102  }
103103
104104  os_profile_linux_config  {
105-     disable_password_authentication  =  false 
105+       disable_password_authentication  =  true 
106+       ssh_keys  {
107+           path      =  " /home/${ var . admin_username } /.ssh/authorized_keys" 
108+           key_data  =  " ${ var . ssh_pubkey } " 
109+       }
106110  }
107111
112+ #  TODO: have Dylan help with apache.yml playbook
108113  provisioner  "local-exec"  {
109114    command  =  " ansible-playbook -i '${ self . public_ip } ,' --private-key ${ var . ssh_key }  apache.yml" 
110115  }
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_pubkey"  {
13+   description  =  " Public half of SSH key for connecting to our Red Hat instance." 
14+ }
15+ 
1216variable  "resource_group"  {
1317  description  =  " The name of your Azure Resource Group." 
1418  default      =  " Terraform-Azure-Beginners" 
@@ -61,17 +65,17 @@ variable "vm_size" {
6165
6266variable  "image_publisher"  {
6367  description  =  " Name of the publisher of the image (az vm image list)" 
64-   default      =  " Canonical " 
68+   default      =  " RedHat " 
6569}
6670
6771variable  "image_offer"  {
6872  description  =  " Name of the offer (az vm image list)" 
69-   default      =  " UbuntuServer " 
73+   default      =  " RHEL " 
7074}
7175
7276variable  "image_sku"  {
7377  description  =  " Image SKU to apply (az vm image list)" 
74-   default      =  " 16.04-LTS " 
78+   default      =  " 7.3 " 
7579}
7680
7781variable  "image_version"  {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments