Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/ansible-test-plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Plugins CI
on:
push:
paths:
- 'plugins/**'
- 'tests/**'
- '.github/workflows/ansible-test.yml'
pull_request:
paths:
- 'plugins/**'
- 'tests/**'
- '.github/workflows/ansible-test.yml'
schedule:
- cron: '0 6 * * *'


env:
mysql_version_file: "./ansible_collections/community/mysql/tests/integration/targets/setup_mysql/defaults/main.yml"

jobs:
sanity:
name: "Sanity (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }})"
runs-on: ubuntu-latest
strategy:
matrix:
ansible:
- stable-2.9
- stable-2.10
- devel
python:
- 2.7
- 3.8
steps:

- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/mysql

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Run sanity tests
run: ansible-test sanity --docker -v --color
working-directory: ./ansible_collections/community/mysql

integration:
name: "Integration (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }}, MySQL: ${{ matrix.mysql }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mysql:
- 8.0.20
ansible:
- stable-2.9
- stable-2.10
- devel
python:
- 3.6
steps:

- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/mysql

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Set MySQL version (${{ matrix.mysql }})
run: "sed -i 's/^mysql_version:.*/mysql_version: \"${{ matrix.mysql }}\"/g' ${{ env.mysql_version_file }}"

- name: Run integration tests
run: ansible-test integration --docker -v --color --retry-on-error --continue-on-error --python ${{ matrix.python }} --diff --coverage
working-directory: ./ansible_collections/community/mysql

- name: Generate coverage report.
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: ./ansible_collections/community/mysql

- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
56 changes: 56 additions & 0 deletions .github/workflows/ansible-test-roles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Roles CI
on:
push:
paths:
- 'roles/**'
- '.github/workflows/ansible-test-roles.yml'
pull_request:
paths:
- 'roles/**'
- '.github/workflows/ansible-test-roles.yml'
schedule:
- cron: '0 6 * * *'

jobs:
molecule:
name: "Molecule (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }}, MySQL: ${{ matrix.mysql }})"
runs-on: ubuntu-latest
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
matrix:
mysql:
- 2.0.12
ansible:
- stable-2.9
### it looks like there's errors for 2.10+ with ansible-lint (https://github.com/ansible/ansible-lint/pull/878)
### and molecule (_maybe_ relating to https://github.com/ansible-community/molecule/pull/2547)
# - stable-2.10
# - devel
python:
- 2.7
- 3.8

steps:

- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/mysql

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

- name: Install molecule and related dependencies
run: |
pip install ansible-lint docker flake8 molecule testinfra yamllint

# - name: Run molecule default test scenario
# run: for d in roles/*/; do (cd "$d" && molecule --version && molecule test) done
# working-directory: ./ansible_collections/community/mysql
93 changes: 0 additions & 93 deletions .github/workflows/ansible-test.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@ dmypy.json

# Pyre type checker
.pyre/

# MacOS
.DS_Store
File renamed without changes.
63 changes: 30 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
# collection_template
You can build a new repository for an Ansible Collection using this template by following [Creating a repository from a template](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template). This README.md contains recommended headings for your collection README.md, with comments describing what each section should contain. Once you have created your collection repository, delete this paragraph and the title above it from your README.md.
# MySQL collection for Ansible
[![Plugins CI](https://github.com/ansible-collections/community.mysql/workflows/Plugins%20CI/badge.svg?event=push)](https://github.com/ansible-collections/community.mysql/actions?query=workflow%3A"Plugins+CI") [![Roles CI](https://github.com/ansible-collections/community.mysql/workflows/Roles%20CI/badge.svg?event=push)](https://github.com/ansible-collections/community.mysql/actions?query=workflow%3A"Roles+CI") [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.mysql)](https://codecov.io/gh/ansible-collections/community.mysql)

# Foo Collection
<!-- Add CI and code coverage badges here. Samples included below. -->
[![CI](https://github.com/ansible-collections/REPONAMEHERE/workflows/CI/badge.svg?event=push)](https://github.com/ansible-collections/REPONAMEHERE/actions) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/REPONAMEHERE)](https://codecov.io/gh/ansible-collections/REPONAMEHERE)
## Included content

<!-- Describe the collection and why a user would want to use it. What does the collection do? -->
- **Modules**:
- [mysql_db](https://docs.ansible.com/ansible/latest/modules/mysql_db_module.html)
- [mysql_info](https://docs.ansible.com/ansible/latest/modules/mysql_info_module.html)
- [mysql_query](https://docs.ansible.com/ansible/latest/modules/mysql_query_module.html)
- [mysql_replication](https://docs.ansible.com/ansible/latest/modules/mysql_replication_module.html)
- [mysql_user](https://docs.ansible.com/ansible/latest/modules/mysql_user_module.html)
- [mysql_variables](https://docs.ansible.com/ansible/latest/modules/mysql_variables_module.html)

## Tested with Ansible

<!-- List the versions of Ansible the collection has been tested with. Must match what is in galaxy.yml. -->
- 2.9
- 2.10
- devel

## External requirements

<!-- List any external resources the collection depends on, for example minimum versions of an OS, libraries, or utilities. Do not list other Ansible collections here. -->

### Supported connections
<!-- Optional. If your collection supports only specific connection types (such as HTTPAPI, netconf, or others), list them here. -->

## Included content
The MySQL modules rely on a MySQL connector. The list of supported drivers is below:

<!-- Galaxy will eventually list the module docs within the UI, but until that is ready, you may need to either describe your plugins etc here, or point to an external docsite to cover that information. -->
- [PyMySQL](https://github.com/PyMySQL/PyMySQL)
- [MySQLdb](https://github.com/PyMySQL/mysqlclient-python)
- Support for other Python MySQL connectors may be added in a future release.

## Using this collection

<!--Include some quick examples that cover the most common use cases for your collection content. -->

See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.
### Installing the Collection from Ansible Galaxy

## Contributing to this collection
Before using the MySQL collection, you need to install it with the Ansible Galaxy CLI:

<!--Describe how the community can contribute to your collection. At a minimum, include how and where users can create issues to report problems or request features for this collection. List contribution requirements, including preferred workflows and necessary testing, so you can benefit from community PRs. If you are following general Ansible contributor guidelines, you can link to - [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html). -->
```bash
ansible-galaxy collection install community.mysql
```

You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:

## Release notes
<!--Add a link to a changelog.md file or an external docsite to cover this information. -->
```yaml
---
collections:
- name: community.mysql
version: v0.1.0
```

## Roadmap

<!-- Optional. Include the roadmap for this collection, and the proposed release/versioning strategy so users can anticipate the upgrade/update cycle. -->

## More information

<!-- List out where the user can find additional information, such as working group meeting times, slack/IRC channels, or documentation for the product this collection automates. At a minimum, link to: -->

- [Ansible Collection overview](https://github.com/ansible-collections/overview)
- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.

## Licensing

Expand Down
29 changes: 29 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
changelog_filename_template: CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Community.Mysql
trivial_section_name: trivial
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
- "/ansible_collections/community/mysql/::"
16 changes: 16 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace: community
name: mysql
version: 0.1.0
readme: README.md
authors:
- MySQL Working Group (https://github.com/ansible/community/wiki/MySQL)
description: MySQL collection for Ansible
license_file: COPYING
tags:
- database
- mysql
- mariadb
repository: https://github.com/ansible-collections/community.mysql
documentation: https://github.com/ansible-collections/community.mysql
homepage: https://github.com/ansible-collections/community.mysql
issues: https://github.com/ansible-collections/community.mysql/issues
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
requires_ansible: '>=2.9.10'
Loading