jesperberth.az_securitygroup
Az_securitygroup
Tworzy grupę zasobów w Microsoft Azure
Wymagania
Wymaga Azure SDK
pip install 'ansible[azure]'
Zmienne roli
Rola przyjmuje następujące zmienne
resourcegroup = nazwa grupy zasobów do utworzenia
location = lokalizacja Azure, w której ma zostać utworzona grupa zasobów
tag_owner = utworzenie tagu właściciela z wartością
tag_project = utworzenie tagu projektu z wartością
networksecuritygroup_name = nazwa grupy zabezpieczeń
rulename = nazwa zasady
ruleprotocol = typ protokołu (Any/Tcp/Udp/Icmp)
rulesourceaddress = adres IP źródłowy, np. 0.0.0.0/0
ruledestinationportrange = port docelowy, np. 443 dla HTTPS
ruleaccess = Zezwól/Odmów
rulepriority = priorytet w stosunku do innych zasad
ruledirection = Przychodzący/Odchodzący
Zależności
Brak
Przykład playbooka
- hosts: localhost
name: Tworzenie grupy zabezpieczeń Azure
vars:
resourcegroup_name: resourcegroupname
location: northeurope
tag_owner: jesper
tag_project: demoproject
tasks:
- name: Grupa zabezpieczeń Azure
include_role:
name: jesperberth.az_securitygroup
vars:
resourcegroup: "{{ resourcegroup_name }}"
networksecuritygroup_name: SG_Network
rulename: "AllowHTTPS"
ruleprotocol: "Tcp"
rulesourceaddress: 0.0.0.0/0
ruledestinationportrange: "443"
ruleaccess: "Allow"
rulepriority: "101"
ruledirection: "Inbound"
Z wieloma zasadami w pętli
- hosts: localhost
name: Tworzenie grupy zabezpieczeń Azure
vars:
resourcegroup_name: resourcegroupname
location: northeurope
tag_owner: jesper
tag_project: demoproject
tasks:
- name: Grupa zabezpieczeń Azure
include_role:
name: jesperberth.az_securitygroup
vars:
resourcegroup: "{{ resourcegroup_name }}"
networksecuritygroup_name: "{{ item.networksecuritygroup_name }}"
rulename: "{{ item.rulename }}"
ruleprotocol: "{{ item.ruleprotocol }}"
rulesourceaddress: "{{ item.rulesourceaddress }}"
ruledestinationportrange: "{{ item.ruledestinationportrange }}"
ruleaccess: "{{ item.ruleaccess }}"
rulepriority: "{{ item.rulepriority }}"
ruledirection: "{{ item.ruledirection }}"
loop:
- { networksecuritygroup_name: 'SG_Network', rulename: 'AllowHTTP', ruleprotocol: 'Tcp', rulesourceaddress: '0.0.0.0/0', ruledestinationportrange: '80', ruleaccess: 'Allow', rulepriority: '102', ruledirection: 'Inbound' }
- { networksecuritygroup_name: 'SG_Network', rulename: 'AllowHTTPS', ruleprotocol: 'Tcp', rulesourceaddress: '0.0.0.0/0', ruledestinationportrange: '443', ruleaccess: 'Allow', rulepriority: '103', ruledirection: 'Inbound' }
Licencja
BSD
Informacje o autorze
Jesper Berth
Zainstaluj
ansible-galaxy install jesperberth.az_securitygroup
Licencja
Unknown
Pobrania
183
Właściciel