diff --git a/.github/workflows/ansible_lint.yaml b/.github/workflows/ansible_lint.yaml new file mode 100644 index 0000000..a3b1c66 --- /dev/null +++ b/.github/workflows/ansible_lint.yaml @@ -0,0 +1,16 @@ +name: ansible-lint +on: + pull_request: +jobs: + build: + name: Ansible Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run ansible-lint + uses: ansible/ansible-lint@c629b235398065e24ff44b5f1138028642c74a03 + with: + args: "" + setup_python: "true" + working_directory: "" + requirements_file: "" diff --git a/.github/workflows/deploy_msm.yaml b/.github/workflows/deploy_msm.yaml index 0375125..3327e9c 100644 --- a/.github/workflows/deploy_msm.yaml +++ b/.github/workflows/deploy_msm.yaml @@ -29,11 +29,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # @v4 - + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #@v5 with: python-version: '3.11' - + - name: Setup ansible run: pip install ansible && export PATH="$HOME/.local/bin:$PATH" && ansible-galaxy collection install cloud.terraform && ansible-galaxy collection install datadog.dd @@ -41,7 +41,7 @@ jobs: uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # @v3 with: terraform_version: 1.8.3 - + - name: Setup backend run: | echo "bucket = \"${{ secrets.BUCKET_TF_STATE }}\"" > backend.tfvars @@ -57,7 +57,7 @@ jobs: id: fmt run: terraform fmt -check working-directory: ./terraform/ - + - name: Terraform validate run: | echo "${{ secrets.SSH_PRIVATE_KEY }}" > messh @@ -76,12 +76,12 @@ jobs: sudo wg set wg0 listen-port 48123 private-key privatekey peer ${{ secrets.WIREGUARD_PEER_PUBLIC_KEY }} allowed-ips 0.0.0.0/0 endpoint ${{ secrets.WIREGUARD_ENDPOINT }} sudo ip link set up dev wg0 rm privatekey - + - name: Terraform Apply run: | terraform apply -auto-approve -input=false -var-file=${{ inputs.environment }}.tfvars working-directory: ./terraform/ - + - name: Run playbook run: sleep 20 && export PATH="$HOME/.local/bin:$PATH" && ansible-playbook -i inventory.yaml mesh_services_monitoring.yaml working-directory: ./ansible/ diff --git a/ansible/dd_monitor/tasks/main.yaml b/ansible/dd_monitor/tasks/main.yaml index bcfab07..5863617 100644 --- a/ansible/dd_monitor/tasks/main.yaml +++ b/ansible/dd_monitor/tasks/main.yaml @@ -27,33 +27,33 @@ - name: Install datadog-ping ansible.builtin.command: datadog-agent integration install -r -t datadog-ping==1.0.2 -- name: dns_check +- name: Deploy dns_check ansible.builtin.template: - src: ../templates/dns_check.d.conf.yaml.j2 + src: dns_check.d.conf.yaml.j2 dest: /etc/datadog-agent/conf.d/dns_check.d/conf.yaml mode: "600" owner: dd-agent group: dd-agent -- name: http_check +- name: Deploy http_check ansible.builtin.template: - src: ../templates/http_check.d.conf.yaml.j2 + src: http_check.d.conf.yaml.j2 dest: /etc/datadog-agent/conf.d/http_check.d/conf.yaml mode: "600" owner: dd-agent group: dd-agent -- name: ping +- name: Deploy ping ansible.builtin.template: - src: ../templates/ping.d.conf.yaml.j2 + src: ping.d.conf.yaml.j2 dest: /etc/datadog-agent/conf.d/ping.d/conf.yaml mode: "600" owner: dd-agent group: dd-agent -- name: tcp_check +- name: Deploy tcp_check ansible.builtin.template: - src: ../templates/tcp_check.d.conf.yaml.j2 + src: tcp_check.d.conf.yaml.j2 dest: /etc/datadog-agent/conf.d/tcp_check.d/conf.yaml mode: "600" owner: dd-agent diff --git a/ansible/mesh_services_monitoring.yaml b/ansible/mesh_services_monitoring.yaml index f5577e5..9a41355 100644 --- a/ansible/mesh_services_monitoring.yaml +++ b/ansible/mesh_services_monitoring.yaml @@ -1,4 +1,5 @@ -- hosts: monitor_mgt +- name: Mesh Services Monitoring + hosts: monitor_mgt become: true roles: - role: dd_monitor