3 コミット

作成者 SHA1 メッセージ 日付
  jdongmo 61afb7f682 Add playbook to manage some azure resources 4年前
  jdongmo f5faadc302 Add script to check jinja syntax 4年前
  jdongmo c9e757be40 Add Dockerfile 4年前
12個のファイルの変更121行の追加0行の削除
分割表示
  1. +23
    -0
      Dockerfile
  2. +18
    -0
      files/check_jinja_syntax.py
  3. +8
    -0
      playbook_application_gateway.yml
  4. +8
    -0
      playbook_backendpool.yml
  5. +8
    -0
      playbook_local_network_gateway.yml
  6. +8
    -0
      playbook_managed_disk.yml
  7. +8
    -0
      playbook_other_resource.yml
  8. +8
    -0
      playbook_public_ip.yml
  9. +8
    -0
      playbook_ssh_public_key.yml
  10. +8
    -0
      playbook_udr.yml
  11. +8
    -0
      playbook_virtual_machine_extension.yml
  12. +8
    -0
      playbook_virtual_network_gateway.yml

+ 23
- 0
Dockerfile ファイルの表示

@@ -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"]

+ 18
- 0
files/check_jinja_syntax.py ファイルの表示

@@ -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)

+ 8
- 0
playbook_application_gateway.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage application gateway
hosts:
- all
gather_facts: no
roles:
- {role: azure_agw, tags: ["azure", "agw"]}
...

+ 8
- 0
playbook_backendpool.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage backendpool
hosts:
- all
gather_facts: no
roles:
- {role: azure_bp, tags: ["azure", "bp"]}
...

+ 8
- 0
playbook_local_network_gateway.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage local network gateway
hosts:
- all
gather_facts: no
roles:
- {role: azure_lngw, tags: ["azure", "lngw"]}
...

+ 8
- 0
playbook_managed_disk.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage managed disk
hosts:
- all
gather_facts: no
roles:
- {role: azure_disk, tags: ["azure", "disk"]}
...

+ 8
- 0
playbook_other_resource.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage any resource
hosts:
- all
gather_facts: no
roles:
- {role: azure_res, tags: ["azure", "res"]}
...

+ 8
- 0
playbook_public_ip.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage public IP
hosts:
- all
gather_facts: no
roles:
- {role: azure_ip, tags: ["azure", "ip"]}
...

+ 8
- 0
playbook_ssh_public_key.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage ssh public key
hosts:
- all
gather_facts: no
roles:
- {role: azure_spk, tags: ["azure", "spk"]}
...

+ 8
- 0
playbook_udr.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage user defined route
hosts:
- all
gather_facts: no
roles:
- {role: azure_udr, tags: ["azure", "udr"]}
...

+ 8
- 0
playbook_virtual_machine_extension.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage virtual machine extension
hosts:
- all
gather_facts: no
roles:
- {role: azure_vmext, tags: ["azure", "vmext"]}
...

+ 8
- 0
playbook_virtual_network_gateway.yml ファイルの表示

@@ -0,0 +1,8 @@
---
- name: Manage virtual network gateway
hosts:
- all
gather_facts: no
roles:
- {role: azure_vngw, tags: ["azure", "vngw"]}
...

読み込み中…
キャンセル
保存