Skip to content

Commit

Permalink
feat: ansible collection for snowdrop.cloud_infra
Browse files Browse the repository at this point in the history
docs: improved docs on OpenStack usage

feat: playbook to init the ansible controller

feat: GoDaddy DNS record manipulation

docs: set the README for the roles

fix: problems found when deploying kubernetes 1.24.3 cluster
  • Loading branch information
jacobdotcosta committed Aug 10, 2023
1 parent 027fe9f commit 4995763
Show file tree
Hide file tree
Showing 164 changed files with 5,766 additions and 844 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Pull Request Test
on:
push:
workflow_dispatch:
pull_request:

jobs:
test-openstack-roles:
name: Test Collection Openstack Roles
runs-on: ubuntu-latest
strategy:
matrix:
openstack_version: ["master"]
# python: [ pypy3.8 ]
python: [ 3.11 ]
roles: [openstack_vm]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Deploy devstack
uses: EmilienM/[email protected]
with:
branch: ${{ matrix.openstack_version }}
enabled_services: 'ir-api,s-account,s-container,s-object,s-proxy,swift'
cache: devstack
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install python requirements
run: pip install -r requirements.txt
- name: Build Ansible Collection
run: ansible-galaxy collection build ansible/ansible_collections/snowdrop/cloud_infra --output build/ --force
- name: Install Ansible Collection
run: ansible-galaxy collection install build/snowdrop-cloud_infra-$(yq -r .version ansible/ansible_collections/snowdrop/cloud_infra/galaxy.yml).tar.gz --upgrade
- name: Run tests
run: |
molecule test --scenario-name github
working-directory: ansible/ansible_collections/snowdrop/cloud_infra/roles/${{ matrix.roles }}
...
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ ansible/roles/test/
ansible/remote-k8s-config.yml

**/test.sh
**/tests/
_tmp
*.tar.gz
output/**


# Testing purposes
sandbox/cluster_up/test.sh
.snowdrop-venv/

#######
# IDE #
Expand Down
28 changes: 15 additions & 13 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
= Automating the deployment of a kubernetes/ocp cluster
Snowdrop Team (Charles Moulliard, Antonio Costa)
:icons: font
:revdate: {docdate}
:toc: macro
:toc: left
:toclevels: 3
ifdef::env-github[]
:tip-caption: :bulb:
Expand All @@ -10,9 +12,7 @@ ifdef::env-github[]
:warning-caption: :warning:
endif::[]

toc::[]

= Automating the deployment of a kubernetes/ocp cluster
== Introduction

This project details the `prerequisites` and `steps` necessary to automate the installation of a Kubernetes (aka k8s) cluster or Openshift 4 top of one of the following cloud provider:

Expand All @@ -24,6 +24,16 @@ This project details the `prerequisites` and `steps` necessary to automate the i

NOTE: kind is not a cloud provider but a tool able to run a k8s cluster on a container engine

== Before you start

[WARNING]
====
All the commands mentioned on this project are to be executed at the root folder of the repository, except if stated otherwise.
====

This project uses Ansible. Check the link:ansible/README.adoc[Ansible Document] for the
installation and usage instrutions.

== Prerequisites

To use the scripts, playbooks, part of this project, some prerequisites are needed. It is not mandatory to install
Expand All @@ -36,14 +46,6 @@ all of them and the following chapters will mention which ones are needed.
* https://www.passwordstore.org/[passwordstore]
* https://github.com/hetznercloud/cli[hcloud] (optional)

NOTE: Check the Ansible https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix[requirement] page for Python compatibility !

TIP: To install ansible, we recommend to use pip3
[,console]
----
# Ansible 7.6 corresponds to Ansible community version: 2.14.6
pip3 install ansible==7.6.0
----

== Locally

Expand Down Expand Up @@ -94,7 +96,7 @@ This section details how to provision an Openshift 4 cluster using one of Red Ha

_Tools: password store, ansible_

The xref:openstack/README.adoc[OpenStack] page explains how to create an OpenStack cloud vm using
The link:openstack/README.adoc[OpenStack] page explains how to create an OpenStack cloud vm using

==== https://resourcehub.redhat.com/[Resource Hub]

Expand Down
9 changes: 6 additions & 3 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[defaults]
# tag::inventory_location[]
inventory = ansible/inventory/
# Needed to be able to override selected variables from the command line
# end::inventory_location[]

hash_behaviour = merge
roles_path = ansible/roles/

# callback plugins:
# . profile_tasks: Shows time each task took
callback_whitelist = profile_tasks
gather_timeout = 5000

log_path=/opt/log/ansible.log
Loading

0 comments on commit 4995763

Please sign in to comment.