asc.core.common role – Shared defaults and helper tasks for the ASC collections

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.common.

Entry point add-guac-connection – Add a Guacamole connection for a user

New in asc.core 1.0.0

Synopsis

  • Add a Guacamole connection for a user

Parameters

Parameter

Comments

target_connection_groups

list / elements=string

List of connection groups to add (Terraform resource identifier)

target_connections

list / elements=string

List of connections to add (Terraform resource identifier)

target_email

string

Email address of the target user to add the connection for

target_user

string

Username of the target user to add the connection for

Authors

  • Ignace De Cock

Entry point add_winget_source – Register the private ASC WinGet source

New in asc.core 2.0.0

Synopsis

  • Registers the private WinGet REST source on a Windows host if it is not registered yet.

Parameters

Parameter

Comments

common_winget_source_name

string

added in asc.core 2.0.0

Name the private WinGet REST source is registered under.

Default: "ASCPrivateWinget"

common_winget_source_url

string

added in asc.core 2.0.0

URL of the private WinGet REST source (Azure Function App). The role default carries the Function App access key, so it is not repeated here.

Authors

  • Ignace De Cock

Entry point configure-ssh – Configure SSH connection for Guacamole access

New in asc.core 1.0.0

Synopsis

  • Configure SSH connection for Guacamole access

Parameters

Parameter

Comments

admin_password

string

Password of the admin user on the target system

admin_username

string

Username of the admin user on the target system

guac_ssh_pubkey

string

Public key to use for the Guacamole SSH connection

Authors

  • Ignace De Cock

Entry point create-ssl-selfsignedcert – Create a self-signed SSL certificate

New in asc.core 1.0.0

Synopsis

  • Create a self-signed SSL certificate

Parameters

Parameter

Comments

pkcs_keystore

boolean

Create a PKCS keystore

Choices:

  • false

  • true

sslcert_cert_file_path

string / required

Path to the SSL certificate file

sslcert_key_file_path

string / required

Path to the SSL key file

sslcert_subject_common_name

string / required

Common name of the SSL certificate subject

sslcert_subject_country_name

string / required

Country name of the SSL certificate subject

sslcert_subject_email_address

string / required

Email address of the SSL certificate subject

sslcert_subject_organization_name

string / required

Organization name of the SSL certificate subject

Authors

  • Ignace De Cock

Entry point generate-ssh-keypair – Generate a SSH keypair

New in asc.core 1.0.0

Synopsis

  • Generate a SSH keypair

Authors

  • Ignace De Cock

Entry point import-students – Import students from ‘users’ variable

New in asc.core 1.0.0

Synopsis

  • Import students from ‘users’ variable

  • Filters the list of users and selects only the ones with the ‘student’ tag

  • For each user, generate an ID (2 digits, incremental) and store it in the ‘id’ variable

  • For each user, store the name of the assigned VM in the ‘vm’ variable

Parameters

Parameter

Comments

users

dictionary / required

List of users

Authors

  • Ignace De Cock

Entry point install_winget_packages – Install WinGet packages from the private ASC WinGet source

New in asc.core 2.0.0

Synopsis

  • Ensures the WinGet client, registers the private source, prepares the host for unattended installs (SmartScreen, Mark-of-the-Web, Defender exclusions) and imports winget_packages.

Parameters

Parameter

Comments

common_winget_become

boolean

Run the import under an interactive logon (runas) instead of the connection user. Leave it off for MSI installers that hang without a desktop session.

Choices:

  • false ← (default)

  • true

common_winget_desktop_user

string

When set, links that user’s WinGet packages folder onto their desktop.

common_winget_import_timeout

integer

Seconds to wait for the import before it is stopped.

Default: 1800

common_winget_source_name

string

added in asc.core 2.0.0

Name the private WinGet REST source is registered under.

Default: "ASCPrivateWinget"

common_winget_source_url

string

added in asc.core 2.0.0

URL of the private WinGet REST source (Azure Function App). The role default carries the Function App access key, so it is not repeated here.

winget_packages

list / elements=dictionary

Packages to install, each with the WinGet package id, an optional pinned version and an optional scope.

id

string / required

WinGet package identifier.

scope

string

Install scope passed to WinGet. Portable (zip) packages ignore their manifest scope and land in the connection user’s profile unless this is machine, which puts them under C:\Program Files\WinGet\Packages. Their permissions are then reset to the Program Files defaults so service accounts can read them, since WinGet moves them in with the installing user’s temp-folder permissions.

Choices:

  • "user"

  • "machine"

version

string

Package version to install; the latest when unset.

Authors

  • Ignace De Cock

Entry point main – Shared defaults and helper tasks for the ASC collections

New in asc.core 1.0.0

Synopsis

  • Base role used by every ASC collection. Its task files are invoked individually via tasks_from (for example terraform-config or install_winget_packages); running the role directly performs no actions.

Authors

  • Ignace De Cock

Entry point terraform-config – Render and run the Terraform configuration for a role

New in asc.core 1.0.0

Synopsis

  • Merges the cross-collection vnet config, renders a role’s templates/ Terraform files into common_terraform_dir and drives the plan/apply/destroy lifecycle.

Parameters

Parameter

Comments

common_terraform_apply

boolean

Run the apply operation and provision the infrastructure.

Choices:

  • false ← (default)

  • true

common_terraform_config

boolean

Regenerate the Terraform configuration files from templates; when false the existing rendered files are reused.

Choices:

  • false

  • true ← (default)

common_terraform_destroy

boolean

Run the destroy operation. This destroys the entire infrastructure.

Choices:

  • false ← (default)

  • true

common_terraform_dir

string

Directory holding the Terraform state and the generated configuration files.

Default: "./terraform"

common_terraform_plan

boolean

Run the plan operation (implied when common_terraform_apply or common_terraform_destroy is set).

Choices:

  • false

  • true ← (default)

common_terraform_template_dir

string

added in asc.core 2.0.0

Subfolder of a role’s templates/ that holds its Terraform templates.

Default: "terraform"

Authors

  • Ignace De Cock