| Autor | SHA1 | Wiadomość | Data |
|---|---|---|---|
|
|
61afb7f682 | Add playbook to manage some azure resources | 4 lat temu |
|
|
f5faadc302 | Add script to check jinja syntax | 4 lat temu |
|
|
c9e757be40 | Add Dockerfile | 4 lat temu |
| @@ -0,0 +1,23 @@ | |||||
| FROM python:3.8-alpine | |||||
| RUN apk update && \ | |||||
| apk add --no-cache --virtual .build-deps make gcc musl-dev python3-dev \ | |||||
| python3 libffi libffi-dev openssl-dev openssh-client cargo vim bash | |||||
| RUN ls /usr/bin/python3 && ln -s /usr/bin/python3 /usr/bin/python && \ | |||||
| ls /usr/local/bin/python3 && ln -s /usr/local/bin/python3 /usr/bin/python3 | |||||
| WORKDIR /opt/ansible | |||||
| COPY requirements.txt /opt/ansible | |||||
| RUN pip3 install --no-cache-dir -r requirements.txt && \ | |||||
| ansible-galaxy collection install paloaltonetworks.panos | |||||
| RUN apk del .build-deps | |||||
| COPY . /opt/ansible | |||||
| RUN find /opt/ansible -type f -exec dos2unix -u {} \; | |||||
| RUN adduser -S -u 1044 ansible-user | |||||
| USER ansible-user | |||||
| CMD ["/bin/bash"] | |||||
| @@ -0,0 +1,18 @@ | |||||
| #!/usr/bin/env python3 | |||||
| # filename: check_jinja_syntax.py | |||||
| import sys | |||||
| import os | |||||
| from jinja2 import Environment, FileSystemLoader | |||||
| #for arg in sys.argv: | |||||
| # print(arg) | |||||
| env = Environment(loader=FileSystemLoader(sys.argv[1])) | |||||
| #templates = [] | |||||
| #for x in env.list_templates(): | |||||
| # if x.endswith('.j2'): | |||||
| # templates.append(x) | |||||
| templates = [x for x in env.list_templates() if x.endswith('.j2')] | |||||
| for template in templates: | |||||
| print(template) | |||||
| t = env.get_template(template) | |||||
| env.parse(t) | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage application gateway | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_agw, tags: ["azure", "agw"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage backendpool | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_bp, tags: ["azure", "bp"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage local network gateway | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_lngw, tags: ["azure", "lngw"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage managed disk | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_disk, tags: ["azure", "disk"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage any resource | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_res, tags: ["azure", "res"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage public IP | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_ip, tags: ["azure", "ip"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage ssh public key | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_spk, tags: ["azure", "spk"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage user defined route | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_udr, tags: ["azure", "udr"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage virtual machine extension | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_vmext, tags: ["azure", "vmext"]} | |||||
| ... | |||||
| @@ -0,0 +1,8 @@ | |||||
| --- | |||||
| - name: Manage virtual network gateway | |||||
| hosts: | |||||
| - all | |||||
| gather_facts: no | |||||
| roles: | |||||
| - {role: azure_vngw, tags: ["azure", "vngw"]} | |||||
| ... | |||||