diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100755 index 0000000..150fa99 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,42 @@ +--- +name: Lint +'on': + pull_request: + push: + branches: + - master + +jobs: + + test: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Check out the codebase. + uses: actions/checkout@v2 + + - name: Set up Python 3.7. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install test dependencies. + run: pip3 install yamllint ansible-lint + + - name: Run yamllint. + run: yamllint . + + - name: Run ansible-lint. + run: ansible-lint + + - name: 'Slack Notification' + uses: clouddrove/action-slack@v2 + with: + status: ${{ job.status }} + fields: repo,author + author_name: 'Clouddrove' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + if: always() diff --git a/.yamllint b/.yamllint new file mode 100755 index 0000000..8f19687 --- /dev/null +++ b/.yamllint @@ -0,0 +1,9 @@ +--- +extends: default + +rules: + line-length: + max: 120 + level: warning + truthy: + allowed-values: ['true', 'false', 'yes', 'no'] diff --git a/defaults/main.yml b/defaults/main.yml index 704466d..5b20b4b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,4 +5,4 @@ php_exporter_server_port: 9253 php_exporter_server_bind: 0.0.0.0 php_exporter_version: 1.0.0 -php_server_uri: "tcp://{{ PrivateIp }}:9000/php-status" \ No newline at end of file +php_server_uri: "tcp://{{ PrivateIp }}:9000/php-status" diff --git a/tasks/install.yml b/tasks/install.yml index d405460..25a367a 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -20,6 +20,7 @@ service: name: php_exporter state: restarted + enabled: true changed_when: false - name: wait for php exporter to become ready @@ -29,4 +30,4 @@ state: started delay: 5 connect_timeout: 15 - timeout: 300 \ No newline at end of file + timeout: 300