darkwizard242.azurecli
Ansible Role: azurecli
This role installs (by default) the azure-cli package on Debian-based and EL-based systems, or removes it (if specified) on those systems.
Requirements
None.
Role Variables
Here are the available variables (found in defaults/main.yml
):
Variables List:
azurecli_pre_reqs_debian:
- apt-transport-https
- curl
- ca-certificates
- lsb-release
- gnupg
azurecli_pre_reqs_debian_desired_state: present
azurecli_app_name: azure-cli
azurecli_desired_state: present
azurecli_debian_gpg_key: https://packages.microsoft.com/keys/microsoft.asc
azurecli_repo_debian: "deb [arch={{ ansible_architecture }}] https://packages.microsoft.com/repos/azure-cli/ {{ ansible_lsb['codename'] }} main"
azurecli_repo_debian_when_x86_64: "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ {{ ansible_lsb['codename'] }} main"
azurecli_repo_debian_filename: "{{ azurecli_app_name }}"
azurecli_el_gpg_key: https://packages.microsoft.com/keys/microsoft.asc
azurecli_repo_el_name: azure-cli
azurecli_repo_el_description: Azure CLI
azurecli_repo_el: https://packages.microsoft.com/yumrepos/azure-cli
azurecli_repo_el_filename: "{{ azurecli_app_name }}"
azurecli_repo_el_gpgcheck: yes
azurecli_repo_el_enabled: yes
azurecli_repo_desired_state: present
Variables Table:
Variable | Description |
---|---|
azurecli_pre_reqs_debian | Packages needed by Azure CLI on Debian-based systems. |
azurecli_pre_reqs_debian_desired_state | Determines if the pre-requisite packages should be installed, checked, or removed (values: present , latest , or absent ). |
azurecli_app_name | The name of the Azure CLI package (i.e., azure-cli ). |
azurecli_desired_state | The desired state of the azure-cli package (values: present , latest , or absent ). |
azurecli_debian_gpg_key | GPG key needed for Azure CLI on Debian-based systems. |
azurecli_el_gpg_key | GPG key needed for Azure CLI on EL-based systems. |
azurecli_repo_debian | Repository URL for Debian-based systems, using ansible_architecture . |
azurecli_repo_debian_when_x86_64 | Used for x86_64 systems where the architecture is set to arch=amd64 as required for Azure CLI installation. |
azurecli_repo_debian_filename | The name of the file storing the repository at /etc/apt/sources.list.d/ on Debian-based systems. |
azurecli_repo_el_name | Repository name for Azure CLI on EL-based systems. |
azurecli_repo_el_description | Description for the Azure CLI repository file on EL-based systems. |
azurecli_repo_el | Base URL for the Azure CLI repository on EL-based systems. |
azurecli_repo_el_gpgcheck | Indicates whether to perform a GPG check against Azure CLI on EL-based systems (true/false). |
azurecli_repo_el_enabled | Indicates if the Azure CLI repo is enabled on EL-based systems (true/false). |
azurecli_repo_desired_state | Indicates whether to create the repository file, or to not have it (use absent cautiously as it may block Azure CLI installation). |
azurecli_repo_el_filename | The name of the file for the repository stored at /etc/yum/sources.list.d/ on EL-based systems. |
Dependencies
None.
Example Playbook
For default operation (installing the azure-cli package) in Ansible playbooks:
- hosts: servers
roles:
- darkwizard242.azurecli
For custom behavior (installing the latest azure-cli package) in Ansible playbooks:
- hosts: servers
roles:
- darkwizard242.azurecli
vars:
azurecli_desired_state: latest
For custom behavior (removing the azure-cli package) in Ansible playbooks:
- hosts: servers
roles:
- darkwizard242.azurecli
vars:
azurecli_desired_state: absent
License
Author Information
This role was created by Ali Muhammad.
Informazioni sul progetto
Azure cli installation on Debian-based and EL-based systems.
Installa
ansible-galaxy install darkwizard242.azurecli
Licenza
mit
Download
22.7k
Proprietario
Senior DevOps/CloudOps Engineer.
Dedicated to Automating everything I come across.
Love to work on and learn new technologies/tools everyday!