...
This commit is contained in:
@@ -51,33 +51,23 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
# Cache Ansible Galaxy Collections
|
|
||||||
- name: Cache Ansible Galaxy Collections
|
- name: Cache Ansible Galaxy Collections
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ansible/collections
|
path: ./ansible/collections
|
||||||
key: ${{ runner.os }}-ansible-${{ hashFiles('./ansible/collections/requirements.yml') }}
|
key: ${{ runner.os }}-ansible-${{ hashFiles('./ansible/collections/requirements.yml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-ansible-
|
${{ runner.os }}-ansible-
|
||||||
# Install Ansible
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
- name: Install Ansible
|
- name: Install Ansible
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip3 install ansible
|
pip3 install ansible
|
||||||
- name: Install Vault
|
- name: Install Vault
|
||||||
uses: cpanato/vault-installer@main
|
uses: cpanato/vault-installer@main
|
||||||
# Install Galaxy Collections
|
|
||||||
- name: Install Galaxy Collections
|
- name: Install Galaxy Collections
|
||||||
if: steps.cache-ansible-galaxy-collections.outputs.cache-hit != 'true'
|
if: steps.cache-ansible-galaxy-collections.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
ansible-galaxy collection install -r ansible/collections/requirements.yml -p ansible/collections
|
ansible-galaxy collection install -r ansible/collections/requirements.yml -p ansible/collections
|
||||||
# Run Docker Config Deployment
|
|
||||||
- name: Docker Config Deployment
|
- name: Docker Config Deployment
|
||||||
id: docker-config-deploy
|
id: docker-config-deploy
|
||||||
uses: arillso/action.playbook@0.0.8
|
uses: arillso/action.playbook@0.0.8
|
||||||
@@ -86,22 +76,19 @@ jobs:
|
|||||||
diff: true
|
diff: true
|
||||||
galaxy_collections_path: ansible/collections
|
galaxy_collections_path: ansible/collections
|
||||||
galaxy_requirements_file: ansible/collections/requirements.yml
|
galaxy_requirements_file: ansible/collections/requirements.yml
|
||||||
inventory: ansible/ansible-inventory.yml
|
inventory: ansible/inventory/hosts.yml
|
||||||
playbook: ansible/docker_config_deploy.yml
|
playbook: ansible/docker_config_deploy.yml
|
||||||
private_key: ${{ secrets.RINOA_ANSIBLE_PRIVATE_KEY }}
|
private_key: ${{ secrets.RINOA_ANSIBLE_PRIVATE_KEY }}
|
||||||
vault_password: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
|
vault_password: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
|
||||||
verbose: 1
|
verbose: 1
|
||||||
# Generate .env File
|
|
||||||
- name: Generate .env file for Docker Compose Dry Run
|
- name: Generate .env file for Docker Compose Dry Run
|
||||||
run: |
|
run: |
|
||||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||||
# Cache .env File
|
|
||||||
- name: Cache .env Files
|
- name: Cache .env Files
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: .env
|
path: .env
|
||||||
key: ${{ runner.os }}-env-${{ hashFiles('docker-compose.yml') }}
|
key: ${{ runner.os }}-env-${{ hashFiles('docker-compose.yml') }}
|
||||||
# Docker Compose Dry Run
|
|
||||||
- name: Docker Compose Dry Run
|
- name: Docker Compose Dry Run
|
||||||
uses: yu-ichiro/spin-up-docker-compose-action@v1
|
uses: yu-ichiro/spin-up-docker-compose-action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[defaults]
|
[defaults]
|
||||||
# Specify the inventory file
|
# Specify the inventory file
|
||||||
inventory = hosts.yml
|
inventory = inventory/hosts.yml
|
||||||
|
|
||||||
collections_path = ./collections
|
collections_path = ./collections
|
||||||
# Set the logging verbosity level
|
# Set the logging verbosity level
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
ansible_host: 192.168.1.254
|
rinoa:
|
||||||
ansible_python_interpreter: /usr/bin/python3
|
ansible_host: 192.168.1.254
|
||||||
ansible_ssh_port: 22
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
ansible_ssh_user: charish
|
ansible_ssh_port: 22
|
||||||
ansible_ssh_pass: !vault |
|
ansible_ssh_user: charish
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
ansible_ssh_pass: !vault |
|
||||||
38346631616139316365316566386362396661323163306339303635646331373061323531626431
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
3435373031363739356261656239633835393963636663370a613166653463656337666366633639
|
38346631616139316365316566386362396661323163306339303635646331373061323531626431
|
||||||
37373637326633363430633336646165343764303063663636313835326130663532323037663331
|
3435373031363739356261656239633835393963636663370a613166653463656337666366633639
|
||||||
6332353339656134370a353435396532663932313535646636333262353238386331313764633635
|
37373637326633363430633336646165343764303063663636313835326130663532323037663331
|
||||||
63383065623930653134666261353439366535646661383434386261393232373432353937636535
|
6332353339656134370a353435396532663932313535646636333262353238386331313764633635
|
||||||
3432336137393737643735346665303832653630316439333565
|
63383065623930653134666261353439366535646661383434386261393232373432353937636535
|
||||||
|
3432336137393737643735346665303832653630316439333565
|
||||||
|
|||||||
Reference in New Issue
Block a user