Skip to content

Conversation

@nicosingh
Copy link
Contributor

@nicosingh nicosingh commented Sep 11, 2019

The idea is to use azurerm_public_ip terraform resources, which are the place where public IP addresses are defined for Azure VMs.

For instance:

resource "azurerm_public_ip" "cheap-worker-vm-ip" {
  name                = "cheap-worker-ip-address"
  location            = "${azurerm_resource_group.my-resource-group.location}"
  resource_group_name = "${azurerm_resource_group.my-resource-group.name}"
  allocation_method   = "Dynamic"

  tags = {
    Role = "cheap-worker"
  }
}

Will match later in ansible-playbook using the defined Role:

---
- hosts: role_cheap-worker
  remote_user: ubuntu
  become: yes
  become_user: root
  tasks:
    - name: install apps
       apt: name=cowsay update_cache=yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant