-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the begginning there was darkness
- Loading branch information
0 parents
commit 1c4d55c
Showing
23 changed files
with
2,144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
skip_list: | ||
- '106' | ||
- '208' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
exclude = .venv/,.tox/,dist/,build/,doc/,.eggs/,molecule/provisioner/ansible/plugins/libraries/goss.py | ||
format = pylint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: CI Keepalive | ||
|
||
on: | ||
schedule: | ||
- cron: "55 23 * * 4" | ||
|
||
jobs: | ||
keepalive: | ||
name: Github Actions keepalive | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gautamkrishnar/keepalive-workflow@master | ||
with: | ||
commit_message: "CI Keepalive" | ||
committer_username: "Ted Cook" | ||
committer_email: "Ted [email protected]" | ||
auto_push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
name: Molecule | ||
|
||
on: | ||
|
||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: "0 5 * * 5" | ||
|
||
defaults: | ||
|
||
run: | ||
working-directory: 'nephelaiio.k8s' | ||
|
||
jobs: | ||
|
||
lint: | ||
|
||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: check out the codebase | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'nephelaiio.k8s' | ||
|
||
- name: set up python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: install poetry | ||
run: pip3 install poetry | ||
|
||
- name: install pips | ||
run: poetry install | ||
|
||
- name: lint code | ||
run: | | ||
set -e | ||
poetry run yamllint . | ||
poetry ansible-lint . | ||
molecule: | ||
|
||
name: molecule | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: | ||
- ubuntu2204 | ||
- ubuntu2004 | ||
- debian11 | ||
- debian10 | ||
- centos7 | ||
steps: | ||
- name: check out the codebase. | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'nephelaiio.k8s' | ||
|
||
- name: set up python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: install poetry | ||
run: pip3 install poetry | ||
|
||
- name: install pips | ||
run: poetry install | ||
|
||
- name: run molecule tests. | ||
run: poetry run molecule test | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
MOLECULE_DOCKER_IMAGE: ${{ matrix.image }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# This workflow requires a GALAXY_API_KEY secret present in the GitHub | ||
# repository or organization. | ||
# | ||
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy | ||
# See: https://github.com/ansible/galaxy/issues/46 | ||
|
||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
defaults: | ||
|
||
run: | ||
working-directory: 'nephelaiio.k8s' | ||
|
||
jobs: | ||
|
||
release: | ||
|
||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check out the codebase. | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'nephelaiio.k8s' | ||
|
||
- name: set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: install poetry | ||
run: pip3 install poetry | ||
|
||
- name: install pips | ||
run: poetry install | ||
|
||
- name: trigger a new import on galaxy | ||
run: >- | ||
poetry run ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo $GITHUB_REPOSITORY | cut -d/ -f1) $(echo $GITHUB_REPOSITORY | cut -d/ -f2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*.swp | ||
.molecule/ | ||
.cache/ | ||
__pycache__/ | ||
Gemfile.lock | ||
**/.ropeproject | ||
playbook.retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
line-length: disable | ||
truthy: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Copyright (c) 2022 Ted Cook | ||
|
||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# nephelaiio.k8s | ||
|
||
[](https://github.com/nephelaiio/ansible-role-k8s/actions) | ||
[](https://galaxy.ansible.com/nephelaiio/k8s/) | ||
|
||
An [ansible role](https://galaxy.ansible.com/nephelaiio/k8s) to install and configure k8s | ||
|
||
## Role Variables | ||
|
||
Please refer to the [defaults file](/defaults/main.yml) for an up to date list of input parameters. | ||
|
||
## Dependencies | ||
|
||
By default this role does not depend on any external roles. If any such dependency is required please [add them](/meta/main.yml) according to [the documentation](http://docs.ansible.com/ansible/playbooks_roles.html#role-dependencies) | ||
|
||
## Example Playbook | ||
|
||
- hosts: servers | ||
roles: | ||
- role: nephelaiio.k8s | ||
k8s_package_state: latest | ||
|
||
## Testing | ||
|
||
Please make sure your environment has [docker](https://www.docker.com) installed in order to run role validation tests. Additional python dependencies are listed in the [requirements file](https://github.com/nephelaiio/ansible-role-requirements/blob/master/requirements.txt) | ||
|
||
Role is tested against the following distributions (docker images): | ||
|
||
* Ubuntu Focal | ||
* Ubuntu Bionic | ||
* Ubuntu Xenial | ||
* CentOS 7 | ||
* Debian Buster | ||
|
||
You can test the role directly from sources using command ` molecule test ` | ||
|
||
## License | ||
|
||
This project is licensed under the terms of the [MIT License](/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
k8s_deployment_prefix: "nephelaiio_" | ||
|
||
k8s_argocd_namespace: argocd | ||
k8s_argocd_state: present | ||
k8s_argocd_chart_url: https://argoproj.github.io/argo-helm | ||
k8s_argocd_chart_release: 4.10.9 | ||
k8s_argocd_chart_customize: true | ||
k8s_argocd_chart_values: | ||
redis-ha: | ||
enabled: true | ||
controller: | ||
replicas: 1 | ||
server: | ||
replicas: 2 | ||
repoServer: | ||
replicas: 2 | ||
applicationSet: | ||
replicas: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
galaxy_info: | ||
role_name: k8s | ||
namespace: nephelaiio | ||
author: nephelaiio | ||
description: Ansible role to bootstrap k8s cluster deployment | ||
license: MIT | ||
min_ansible_version: 2.8 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
- name: Debian | ||
versions: | ||
- all | ||
galaxy_tags: ['k8s'] | ||
|
||
dependencies: | ||
- nephelaiio.plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
******* | ||
Install | ||
******* | ||
|
||
This set of playbooks have specific dependencies on Ansible due to the modules | ||
being used. | ||
|
||
Requirements | ||
============ | ||
|
||
* Ansible 2.2 | ||
* Docker Engine | ||
* docker-py | ||
|
||
Install OS dependencies on CentOS 7 | ||
|
||
.. code-block:: bash | ||
$ sudo yum install -y epel-release | ||
$ sudo yum install -y gcc python-pip python-devel openssl-devel | ||
# If installing Molecule from source. | ||
$ sudo yum install libffi-devel git | ||
Install OS dependencies on Ubuntu 16.x | ||
|
||
.. code-block:: bash | ||
$ sudo apt-get update | ||
$ sudo apt-get install -y python-pip libssl-dev docker-engine | ||
# If installing Molecule from source. | ||
$ sudo apt-get install -y libffi-dev git | ||
Install OS dependencies on Mac OS | ||
|
||
.. code-block:: bash | ||
$ brew install python | ||
$ brew install git | ||
Install using pip: | ||
|
||
.. code-block:: bash | ||
$ sudo pip install ansible | ||
$ sudo pip install docker-py | ||
$ sudo pip install molecule --pre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: converge | ||
|
||
hosts: localhost | ||
|
||
vars: | ||
|
||
k8s_kubeconfig: "/tmp/config.kind.molecule" | ||
|
||
roles: | ||
|
||
- nephelaiio.plugins | ||
- nephelaiio.k8s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
- name: destroy | ||
|
||
hosts: localhost | ||
|
||
connection: local | ||
|
||
gather_facts: true | ||
|
||
vars: | ||
|
||
k8s_kubeconfig: "/tmp/config.kind.molecule" | ||
|
||
tasks: | ||
|
||
- block: | ||
|
||
- name: create temporary directory | ||
local_action: | ||
module: ansible.builtin.tempfile | ||
state: directory | ||
prefix: kind | ||
register: tmpdir | ||
changed_when: false | ||
|
||
- block: | ||
|
||
- name: query kind releases | ||
ansible.builtin.uri: | ||
url: https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | ||
register: kind_release_query | ||
|
||
- name: set kind release target | ||
ansible.builtin.set_fact: | ||
kind_release: "{{ kind_release_query.json.name }}" | ||
|
||
when: kind_release is not defined | ||
|
||
- name: download kind executable | ||
ansible.builtin.get_url: | ||
url: "https://kind.sigs.k8s.io/dl/{{ kind_release.tag }}/kind-{{ ansible_system }}-amd64" | ||
dest: "{{ tmpdir.path }}/kind" | ||
mode: 0777 | ||
changed_when: false | ||
|
||
- name: deploy kind cluster | ||
ansible.builtin.shell: >- | ||
{{ _bin }} get clusters | grep molecule && | ||
{{ _bin }} delete cluster --name molecule | ||
vars: | ||
_bin: "{{ tmpdir.path }}/kind" | ||
|
||
always: | ||
|
||
- name: cleanup temp files | ||
ansible.builtin.file: | ||
state: absent | ||
path: "{{ tmpdir.path }}" |
Oops, something went wrong.