asc.core.core role – Deploy the shared core infrastructure (network, DNS, Key Vault, storage and jumphost)

Note

This role is part of the asc.core collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: git clone git@ssh.dev.azure.com:v3/cloudasc/iac-ansible-collections/core $HOME/.ansible/collections/ansible_collections/asc/core.

To use it in a playbook, specify: asc.core.core.

Entry point main – Deploy the shared core infrastructure (network, DNS, Key Vault, storage and jumphost)

New in asc.core 1.0.0

Synopsis

  • Provisions the foundation every ASC environment builds on - the resource group, virtual networks and subnets, the private DNS zone, an Azure Key Vault for secrets, the shared storage account, and the Linux jumphost that fronts SSH/WinRM access to every other host.

  • Runs in two phases controlled by the common_terraform_* variables: first it renders the Terraform configuration from the role templates and can run plan/apply/destroy, then the configure pass provisions and hardens the jumphost over the generated inventory.

  • This role must be deployed first; the ap, dfir and xhack collections peer their own networks onto the vnets it creates.

Parameters

Parameter

Comments

admin_ssh_key

string / required

SSH public key to use for the admin user on all systems

admin_user

string

Name of the admin user on all systems

Default: "xhackadm"

az_env

string / required

Environment the deployed resources will be tagged with (p: prod, d: dev, t: training, e: demo)

Choices:

  • "p"

  • "d"

  • "t"

  • "e"

az_location

string

Azure location (region) to deploy the resources to

Default: "westeurope"

common_refresh_hosts

boolean

added in asc.core 2.0.0

Refresh the dynamic inventory from the Terraform state after terraform apply. The configure playbooks set this to true.

Choices:

  • false ← (default)

  • true

common_terraform_apply

boolean

Wether to run ‘terraform apply’ or not

Choices:

  • false ← (default)

  • true

common_terraform_config

boolean

If ‘true’, generates new terraform configuration files, otherwise will use the existing ones

Choices:

  • false

  • true ← (default)

common_terraform_destroy

boolean

Wether to run ‘terraform destroy’ or not

Choices:

  • false ← (default)

  • true

common_terraform_dir

string

The directory where the terraform configuration files are located (relative to the deployment folder)

Default: "./terraform"

common_terraform_plan

boolean

Wether to run ‘terraform plan’ or not. (implied if ‘common_terraform_apply’ or ‘common_terraform_destroy’ is ‘true’)

Choices:

  • false

  • true ← (default)

core_vnets_config

dictionary

added in asc.core 2.0.0

Virtual networks for the core services, keyed by vnet name.

Each vnet takes address_space (a CIDR) and subnets, a dict of subnet name to its address_space; a subnet may set allow_all: true to add an allow-all inbound NSG rule.

Merged with the other modules’ vnets into common_vnets_config. See the role defaults for the default layout.

core_vnets_peering

list / elements=dictionary

added in asc.core 2.0.0

Virtual network peerings for the core services, each a primary/secondary pair of vnet names.

Merged with the other modules’ peerings into common_vnets_peering; each peering is created in both directions.

Default: []

primary

string / required

Name of the first vnet.

secondary

string / required

Name of the second vnet.

env_name

string / required

Name of the environment to deploy

internal_domain

string

Internal domain name to use for the deployed resources

Default: "asc.lab"

jumphost

dictionary

added in asc.core 2.0.0

Jumphost VM settings.

hostname

string

Inventory host name of the jumphost, used for its Guacamole SSH connection. Falls back to vmjumphost01 when unset.

vm_name

string

Name of the jumphost VM.

Default: "vmjumphost01"

vm_size

string

Azure VM size of the jumphost.

Default: "Standard_B1s"

linux_temp_path

path

Path to use for temporary files on Linux systems

Default: "/opt/maintenance"

owner

string / required

Email address(es) of the person to contact in case of issues with the Azure resources

subscription_id

string / required

Azure subscription ID to deploy the resources to

team

string / required

tenant_id

string

Azure tenant ID to deploy the resources to

Default: "4285841e-a8d8-4b24-a3d7-d71c2fd59b1b"

terraform_remote_state

dictionary

Dictionary of remote state configuration to use for the terraform deployment. If not specified, the remote state will be stored locally.

container_name

string

Azure storage container name to use for the remote state

enabled

boolean

If ‘true’, the remote state will be enabled

Choices:

  • false ← (default)

  • true

key

string

Key to use for the remote state

Default: "terraform.tfstate"

resource_group_name

string

Azure resource group name to use for the remote state

storage_account_name

string

Azure storage account name to use for the remote state

subscription_id

string

Azure subscription ID to use for the remote state

Default: "The value of 'subscription_id'"

tenant_id

string

Azure tenant ID to use for the remote state

Default: "The value of 'tenant_id'"

timezone

string

Timezone to use for the deployed resources

Default: "Europe/Brussels"

windows_temp_path

path

Path to use for temporary files on Windows systems

Default: "C:\\\\maintenance"

Authors

  • Ignace De Cock