| 
 | 1 | +---  | 
 | 2 | +name: "devsec.mysql_hardening"  | 
 | 3 | +on:  # yamllint disable-line rule:truthy  | 
 | 4 | +  workflow_dispatch:  | 
 | 5 | +  push:  | 
 | 6 | +    paths:  | 
 | 7 | +      - 'roles/mysql_hardening/**'  | 
 | 8 | +      - 'molecule/mysql_hardening/**'  | 
 | 9 | +      - '.github/workflows/mysql_hardening.yml'  | 
 | 10 | +  pull_request:  | 
 | 11 | +    paths:  | 
 | 12 | +      - 'roles/mysql_hardening/**'  | 
 | 13 | +      - 'molecule/mysql_hardening/**'  | 
 | 14 | +      - '.github/workflows/mysql_hardening.yml'  | 
 | 15 | +jobs:  | 
 | 16 | +  build:  | 
 | 17 | +    runs-on: ubuntu-18.04  | 
 | 18 | +    env:  | 
 | 19 | +      PY_COLORS: 1  | 
 | 20 | +      ANSIBLE_FORCE_COLOR: 1  | 
 | 21 | +    strategy:  | 
 | 22 | +      fail-fast: false  | 
 | 23 | +      matrix:  | 
 | 24 | +        molecule_distro:  | 
 | 25 | +          - centos7  | 
 | 26 | +          - centos8  | 
 | 27 | +          - ubuntu1604  | 
 | 28 | +          - ubuntu1804  | 
 | 29 | +          - ubuntu2004  | 
 | 30 | +          - debian9  | 
 | 31 | +          - debian10  | 
 | 32 | +          # - amazon  # geerlingguy.mysql does not support fedora  | 
 | 33 | +          # - arch  # needs to be fixed  | 
 | 34 | +          # - opensuse_tumbleweed  # needs to be fixed  | 
 | 35 | +          # - fedora  # geerlingguy.mysql does not support fedora  | 
 | 36 | +    steps:  | 
 | 37 | +      - name: Checkout repo  | 
 | 38 | +        uses: actions/checkout@v2  | 
 | 39 | +        with:  | 
 | 40 | +          path: ansible_collections/devsec/hardening  | 
 | 41 | +          submodules: true  | 
 | 42 | + | 
 | 43 | +      - name: Set up Python 3.7  | 
 | 44 | +        uses: actions/setup-python@v1  | 
 | 45 | +        with:  | 
 | 46 | +          python-version: 3.7  | 
 | 47 | + | 
 | 48 | +      - name: Install dependencies  | 
 | 49 | +        run: |  | 
 | 50 | +          sudo apt install git  | 
 | 51 | +          python -m pip install --no-cache-dir --upgrade pip  | 
 | 52 | +          pip install -r requirements.txt  | 
 | 53 | +        working-directory: ansible_collections/devsec/hardening  | 
 | 54 | + | 
 | 55 | +      - name: Create default collection path symlink  | 
 | 56 | +        run: |  | 
 | 57 | +          mkdir -p /home/runner/.ansible  | 
 | 58 | +          ln -s /home/runner/work/ansible-os-hardening/ansible-os-hardening /home/runner/.ansible/collections  | 
 | 59 | +
  | 
 | 60 | +      # that was a hard one to fix. robert did it thankfully  | 
 | 61 | +      # https://github.com/robertdebock/ansible-role-mysql/commit/7562e99099b06282391ab7ed102b393a0406d212  | 
 | 62 | +      - name: disable apparmor on debian systems  | 
 | 63 | +        run: |  | 
 | 64 | +            set -x  | 
 | 65 | +            sudo apt-get install apparmor-profiles  | 
 | 66 | +            sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/  | 
 | 67 | +            sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld  | 
 | 68 | +        if: ${{ startsWith(matrix.molecule_distro, 'Debian') }}  | 
 | 69 | + | 
 | 70 | +      - name: Test with molecule  | 
 | 71 | +        run: |  | 
 | 72 | +          molecule --version  | 
 | 73 | +          molecule test -s mysql_hardening  | 
 | 74 | +        env:  | 
 | 75 | +          MOLECULE_DISTRO: ${{ matrix.molecule_distro }}  | 
 | 76 | +        working-directory: ansible_collections/devsec/hardening  | 
0 commit comments