├── .ansible-lint ├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ ├── check_package_build.yml │ ├── clean_b2_old_files.yml │ ├── distro_test.yml │ ├── docs_build.yml │ ├── gitlab_ci_trigger.yml │ ├── linters.yml │ ├── molecule.yml │ ├── quay_mirror.yml │ ├── release.yml │ ├── render_periodic_jobs_status_page.yml │ ├── stale.yml │ └── units.yml ├── .gitignore ├── .gitlab-ci.yml ├── .yamllint ├── Dockerfile ├── LICENSE ├── README.md ├── _skeleton_role_ ├── README.md.j2 ├── defaults │ └── main.yml.j2 ├── files │ └── .gitkeep ├── handlers │ └── main.yml ├── meta │ └── main.yml.j2 ├── molecule │ └── default │ │ ├── converge.yml.j2 │ │ ├── molecule.yml │ │ └── verify.yml ├── tasks │ └── main.yml.j2 └── vars │ └── main.yml.j2 ├── ansible.cfg ├── ci ├── README.md ├── check_ansible_semantics.py ├── check_collection_deps.sh ├── check_labels_consistency.py ├── check_open_build_service.py ├── container_sync.sh ├── gitchangelog.py ├── gitchangelog.rc ├── gitlab_check_new_labels.sh ├── gitlab_ci_trigger.sh ├── gitlab_ci_trigger_test.sh ├── gitlab_merge_request.sh ├── install_gitlab_node.sh ├── kubeinit_ci_logs.html.j2 ├── kubeinit_ci_utils.py ├── launch_e2e.py ├── launch_e2e.sh ├── launch_e2e_ara.sh ├── periodic_jobs.md.j2 ├── pypi_publish.sh ├── release.sh ├── render_periodic_jobs_page.py ├── sanity.sh ├── units.sh └── yamlfind.sh ├── conftest.py ├── docs └── src │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── _exts │ ├── ansible-autodoc.py │ ├── autoyaml.py │ └── ghcontributors.py │ ├── _templates │ └── layout.html │ ├── architecture.rst │ ├── changelog.rst │ ├── conf.py │ ├── contributing.rst │ ├── favicon.ico │ ├── howtos_and_presentations.rst │ ├── images │ ├── mingrammer │ │ ├── .gitignore │ │ ├── README.md │ │ ├── components.py │ │ ├── containers_architecture.py │ │ ├── nodes_architecture.py │ │ ├── ovn_network.py │ │ └── resources │ │ │ ├── kubeinit.png │ │ │ ├── libvirt.png │ │ │ └── ovn.png │ ├── plantuml │ │ ├── .gitignore │ │ ├── ansible_deployment_sequence_diagram.plantuml │ │ └── github_workflow.plantuml │ └── svg │ │ ├── 00_architecture.svg │ │ ├── 00_net.svg │ │ ├── 00_ovn.svg │ │ ├── 01_architecture.svg │ │ └── 01_net.svg │ ├── index.rst │ ├── installation.rst │ ├── inventory_diagrams.rst │ ├── make.bat │ ├── modules.rst │ ├── modules │ ├── .gitkeep │ └── module-kubeinit_package.rst │ ├── notice.rst │ ├── playbook_diagrams.rst │ ├── roles.rst │ ├── roles │ ├── .gitkeep │ ├── role-kubeinit_apache.rst │ ├── role-kubeinit_bind.rst │ ├── role-kubeinit_dnsmasq.rst │ ├── role-kubeinit_haproxy.rst │ ├── role-kubeinit_k8s.rst │ ├── role-kubeinit_libvirt.rst │ ├── role-kubeinit_openshift.rst │ ├── role-kubeinit_prepare.rst │ ├── role-kubeinit_registry.rst │ ├── role-kubeinit_services.rst │ └── role-kubeinit_validations.rst │ ├── static │ ├── css │ │ └── custom.css │ ├── inventory.j2 │ ├── parsers │ │ ├── xhtml1-lat1.txt │ │ ├── xhtml1-special.txt │ │ └── xhtml1-symbol.txt │ └── supporters │ │ ├── backblaze.svg │ │ ├── docker.svg │ │ ├── gcp.svg │ │ ├── ibm.svg │ │ └── rht.svg │ ├── supporters.rst │ ├── usage.rst │ └── white_text_logo.png ├── images ├── favicon.ico ├── fonts │ ├── Quicksand_Bold.otf │ ├── Quicksand_Bold_Oblique.otf │ ├── Quicksand_Book.otf │ ├── Quicksand_Book_Oblique.otf │ ├── Quicksand_Dash.otf │ ├── Quicksand_Light.otf │ └── Quicksand_Light_Oblique.otf ├── icon.png ├── logo.png ├── logo.svg └── logo_white.svg ├── kubeinit ├── README.md ├── build-container-playbook.yml ├── galaxy.yml ├── group_vars │ ├── all.yml │ ├── kubeinit_cluster.yml │ ├── kubeinit_defaults.yml │ ├── kubeinit_env.yml │ ├── kubeinit_facts.yml │ ├── kubeinit_network.yml │ └── kubeinit_secrets.yml ├── inventory.yml ├── meta │ └── runtime.yml ├── playbook.yml ├── plugins │ ├── lookup │ │ └── cli_args.py │ ├── module_utils │ │ └── const.py │ └── modules │ │ └── package.py ├── requirements.yml ├── roles │ ├── kubeinit_apache │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_bind │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── create-external-ingress.sh.j2 │ │ │ ├── internals_db.j2 │ │ │ ├── internals_db.local.j2 │ │ │ ├── named.conf.j2 │ │ │ └── named.conf.local.j2 │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_dnsmasq │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ └── main.yml │ │ ├── templates │ │ │ └── dnsmasq.conf.j2 │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_haproxy │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ └── main.yml │ │ ├── templates │ │ │ └── haproxy.cfg.j2 │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_k8s │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ ├── main.yml │ │ │ ├── post_deployment_tasks.yml │ │ │ └── prepare_cluster.yml │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_libvirt │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ ├── 60_create_cloud_user.yml │ │ │ ├── 70_check_nodes_up.yml │ │ │ ├── cleanup_hypervisors.yml │ │ │ ├── cleanup_libvirt.yml │ │ │ ├── create_network.yml │ │ │ ├── deploy_centos_guest.yml │ │ │ ├── deploy_coreos_guest.yml │ │ │ ├── deploy_debian_guest.yml │ │ │ ├── deploy_ubuntu_guest.yml │ │ │ ├── download_cloud_images.yml │ │ │ ├── gather_host_facts.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── 00-installer-ubuntu-netconfig.yaml.j2 │ │ │ ├── 101-cloudinit-hosts.tmpl.j2 │ │ │ ├── 102-cloudinit-cloud.cfg.j2 │ │ │ ├── 90-cloudinit-dpkg.cfg.j2 │ │ │ ├── authorized_keys.j2 │ │ │ ├── cluster-net.xml.j2 │ │ │ ├── debian-network-config-enp1s0.j2 │ │ │ └── ifcfg-eth0.j2 │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_openshift │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ ├── main.yml │ │ │ ├── post_deployment_tasks.yml │ │ │ └── prepare_cluster.yml │ │ ├── templates │ │ │ └── install-config.yaml.j2 │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_prepare │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ ├── build_hypervisors_group.yml │ │ │ ├── create_host_ssh_config.yml │ │ │ ├── deploy_cluster.yml │ │ │ ├── gather_kubeinit_facts.yml │ │ │ ├── gather_kubeinit_secrets.yml │ │ │ ├── main.yml │ │ │ ├── post_deployment.yml │ │ │ ├── prepare_cluster.yml │ │ │ ├── prepare_groups.yml │ │ │ ├── prepare_hypervisor.yml │ │ │ ├── prepare_hypervisors.yml │ │ │ └── prepare_podman.yml │ │ ├── templates │ │ │ └── ssh-config.j2 │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_registry │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── kubeinit_services │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── .gitkeep │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── molecule │ │ │ └── default │ │ │ │ ├── converge.yml │ │ │ │ ├── molecule.yml │ │ │ │ └── verify.yml │ │ ├── tasks │ │ │ ├── 00_create_service_pod.yml │ │ │ ├── create_managed_service.yml │ │ │ ├── create_provision_container.yml │ │ │ ├── main.yml │ │ │ ├── prepare_credentials.yml │ │ │ ├── prepare_services.yml │ │ │ └── start_services_containers.yml │ │ └── vars │ │ │ └── main.yml │ └── kubeinit_validations │ │ ├── README.md │ │ ├── defaults │ │ └── main.yml │ │ ├── files │ │ └── .gitkeep │ │ ├── handlers │ │ └── main.yml │ │ ├── meta │ │ └── main.yml │ │ ├── molecule │ │ └── default │ │ │ ├── converge.yml │ │ │ ├── molecule.yml │ │ │ └── verify.yml │ │ ├── tasks │ │ ├── 10_libvirt_free_space.yml │ │ ├── 20_libvirt_available_ram.yml │ │ ├── 30_libvirt_check_cpu_cores.yml │ │ └── main.yml │ │ └── vars │ │ └── main.yml └── tests │ ├── sanity │ └── ignore-2.9.txt │ └── unit │ └── test_package.py ├── molecule ├── hosts.ini ├── molecule-requirements.txt ├── molecule-requirements.yml └── run.sh ├── periodic_jobs.md ├── role-addition.yml ├── test-requirements.txt └── tox.ini /.ansible-lint: -------------------------------------------------------------------------------- 1 | --- 2 | parseable: true 3 | skip_list: 4 | - 'experimental' # Dont add any experimental rule 5 | - 'key-order' 6 | - 'truthy' 7 | - 'line-length' # [E204] Lines should be no longer than 120 chars 8 | - 'command-instead-of-module' # [E303] sed used in place of template, replace or lineinfile module 9 | - 'package-latest' # [E403] Package installs should not use latest 10 | - 'var-spacing' 11 | - 'schema' 12 | - 'git-latest' # Git checkouts must contain explicit version. 13 | - 'var-naming' 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Clone '...' 16 | 2. Prepare playbook '...' 17 | 3. Run with these variable '...' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Infrastructure** 27 | - Hypervisors OS: [e.g. CentOS] 28 | - Version [e.g. 8] 29 | 30 | **Deployment command** 31 | 32 | ``` 33 | ansible-playbook ... 34 | ``` 35 | 36 | **Inventory file diff** 37 | 38 | Run the following command: 39 | 40 | ``` 41 | diff \ 42 | <(curl https://raw.githubusercontent.com/Kubeinit/kubeinit/main/kubeinit/hosts/k8s/inventory) \ 43 | <(curl https://raw.githubusercontent.com/Kubeinit/kubeinit/main/kubeinit/hosts/okd/inventory) 44 | ``` 45 | 46 | And paste the output: 47 | 48 | ``` 49 | here 50 | ``` 51 | 52 | **Additional context** 53 | Add any other context about the problem here. 54 | -------------------------------------------------------------------------------- /.github/workflows/check_package_build.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: check_package_build 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'docs/**' 7 | schedule: 8 | - cron: '0 */8 * * *' 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | strategy: 13 | max-parallel: 4 14 | matrix: 15 | python-version: [3.9] 16 | steps: 17 | - uses: actions/checkout@v2 18 | with: 19 | fetch-depth: 0 20 | - name: Set up Python ${{ matrix.python-version }} 21 | uses: actions/setup-python@v1 22 | with: 23 | python-version: ${{ matrix.python-version }} 24 | - name: Run the packages check 25 | run: | 26 | OPEN_BUILD_SERVICE_USER=${{ secrets.OPEN_BUILD_SERVICE_USER }} \ 27 | OPEN_BUILD_SERVICE_PASSWORD=${{ secrets.OPEN_BUILD_SERVICE_PASSWORD }} \ 28 | ./ci/check_open_build_service.py 29 | -------------------------------------------------------------------------------- /.github/workflows/clean_b2_old_files.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: clean_b2_old_files 3 | on: 4 | schedule: 5 | - cron: "0 1 */15 * *" 6 | jobs: 7 | build: 8 | if: github.repository_owner == 'Kubeinit' 9 | runs-on: ubuntu-latest 10 | strategy: 11 | max-parallel: 4 12 | matrix: 13 | python-version: [3.9] 14 | steps: 15 | - uses: actions/checkout@v2 16 | with: 17 | fetch-depth: 0 18 | - name: Set up Python ${{ matrix.python-version }} 19 | uses: actions/setup-python@v1 20 | with: 21 | python-version: ${{ matrix.python-version }} 22 | - name: Install required packages 23 | run: | 24 | sudo apt-get update -y 25 | python3 -m pip install --upgrade protobuf 26 | python3 -m pip install -r test-requirements.txt 27 | python3 -m pip install --upgrade pip 28 | python3 -m pip install --upgrade virtualenv 29 | python3 -m pip install --upgrade setuptools 30 | - name: Clean old b2 files 31 | run: | 32 | # 33 | # When passing env variables to scripts 34 | # they are passed to the non-root user 35 | # if running the script as root it wont 36 | # be able to read those. 37 | # 38 | result=$(python3 < cleaning old B2 files") 45 | initial_time = datetime.now() 46 | clean_old_files_b2() 47 | finish_time = datetime.now() 48 | exec_time = finish_time - initial_time 49 | print("'clean_b2_old_files' ==> Cleaning files in b2 took: %s seconds" % (str(exec_time.total_seconds()))) 50 | EOF 51 | ) 52 | echo $result 53 | env: 54 | B2_STORAGE_ID: ${{ secrets.B2_STORAGE_ID }} 55 | B2_STORAGE_KEY: ${{ secrets.B2_STORAGE_KEY }} 56 | -------------------------------------------------------------------------------- /.github/workflows/gitlab_ci_trigger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: gitlab_ci_trigger 3 | on: 4 | pull_request: 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | max-parallel: 4 10 | matrix: 11 | python-version: [3.9] 12 | steps: 13 | - uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | - name: Set up Python ${{ matrix.python-version }} 17 | uses: actions/setup-python@v1 18 | with: 19 | python-version: ${{ matrix.python-version }} 20 | - name: Test the CI trigger 21 | run: | 22 | ./ci/gitlab_ci_trigger_test.sh 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | -------------------------------------------------------------------------------- /.github/workflows/linters.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: linters 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'docs/**' 7 | pull_request: 8 | # Run the functional tests every 8 hours. 9 | # This will help to identify faster if 10 | # there is a CI failure related to a 11 | # change in any dependency. 12 | schedule: 13 | - cron: '0 */8 * * *' 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | strategy: 18 | max-parallel: 4 19 | matrix: 20 | python-version: [3.9] 21 | steps: 22 | - uses: actions/checkout@v2 23 | with: 24 | fetch-depth: 0 25 | - name: Set up Python ${{ matrix.python-version }} 26 | uses: actions/setup-python@v1 27 | with: 28 | python-version: ${{ matrix.python-version }} 29 | - name: Run a commitlint 30 | uses: wagoid/commitlint-github-action@v2 31 | - name: Install dependencies 32 | run: | 33 | sudo apt-get update -y 34 | sudo apt-get install jq libyaml-dev git build-essential findutils -y 35 | sudo apt-get remove ansible -y 36 | sudo python3 -m pip uninstall ansible ansible-base ansible-core -y 37 | sudo python3 -m pip install -r test-requirements.txt 38 | sudo python3 -m pip install --upgrade --ignore-installed PyYAML 39 | sudo python3 -m pip install --upgrade pip 40 | sudo python3 -m pip install --upgrade virtualenv 41 | sudo python3 -m pip install --upgrade setuptools 42 | - name: Run Linters 43 | run: | 44 | tox -e linters 45 | -------------------------------------------------------------------------------- /.github/workflows/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: molecule 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'docs/**' 7 | pull_request: 8 | # Run the functional tests every 8 hours. 9 | # This will help to identify faster if 10 | # there is a CI failure related to a 11 | # change in any dependency. 12 | schedule: 13 | - cron: '0 */8 * * *' 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | strategy: 18 | max-parallel: 4 19 | matrix: 20 | python-version: [3.9] 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Set up Python ${{ matrix.python-version }} 24 | uses: actions/setup-python@v1 25 | with: 26 | python-version: ${{ matrix.python-version }} 27 | - name: Run molecule tests 28 | run: | 29 | sudo apt update -y 30 | sudo apt install jq -y 31 | sudo apt-get remove ansible -y 32 | sudo python3 -m pip uninstall ansible ansible-base ansible-core -y 33 | sudo locale-gen en_US.UTF-8 34 | sudo dpkg-reconfigure locales 35 | sudo apt install build-essential findutils -y 36 | sudo apt-get --purge autoremove python3-pip 37 | sudo apt install python3-pip -y 38 | sudo python3 -m pip install --upgrade pip 39 | sudo python3 -m pip install --upgrade virtualenv 40 | sudo python3 -m pip install --upgrade setuptools 41 | sudo python3 -m pip install docker 42 | sudo bash ./molecule/run.sh 43 | - uses: actions/upload-artifact@v2 44 | with: 45 | name: MoleculeResultHTML 46 | path: /tmp/reports.html 47 | if-no-files-found: error 48 | -------------------------------------------------------------------------------- /.github/workflows/quay_mirror.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This job will mirror some container 3 | # images from docker.io to quay.io 4 | name: quay_mirror 5 | on: 6 | push: 7 | branches: 8 | - main 9 | # Run the mirror every week 10 | schedule: 11 | - cron: '0 0 * * 0' 12 | jobs: 13 | build: 14 | if: github.repository_owner == 'Kubeinit' 15 | runs-on: ubuntu-latest 16 | strategy: 17 | max-parallel: 4 18 | matrix: 19 | python-version: [3.9] 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Set up Python ${{ matrix.python-version }} 23 | uses: actions/setup-python@v1 24 | with: 25 | python-version: ${{ matrix.python-version }} 26 | - name: Install dependencies 27 | run: | 28 | sudo apt update -y 29 | sudo apt install jq -y 30 | sudo apt-get install skopeo 31 | - name: Mirror to quay 32 | run: | 33 | chmod +x ./ci/container_sync.sh 34 | sudo QUAY_BOT_USER=${{ secrets.QUAY_BOT_USER }} \ 35 | QUAY_BOT_KEY=${{ secrets.QUAY_BOT_KEY }} \ 36 | ./ci/container_sync.sh 37 | -------------------------------------------------------------------------------- /.github/workflows/render_periodic_jobs_status_page.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This job will render the period jobs status page 3 | name: render_periodic_jobs_status_page 4 | on: 5 | push: 6 | branches: 7 | - main 8 | jobs: 9 | build: 10 | if: github.repository_owner == 'Kubeinit' 11 | runs-on: ubuntu-latest 12 | strategy: 13 | max-parallel: 4 14 | matrix: 15 | python-version: [3.9] 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Python ${{ matrix.python-version }} 19 | uses: actions/setup-python@v1 20 | with: 21 | python-version: ${{ matrix.python-version }} 22 | - name: Render periodic_jobs.md 23 | run: | 24 | sudo python3 -m pip uninstall protobuf python3-protobuf 25 | sudo python3 -m pip install --upgrade pip 26 | sudo python3 -m pip install --upgrade protobuf 27 | sudo python3 -m pip install google-cloud-storage 28 | sudo python3 -m pip install b2sdk 29 | sudo python3 ./ci/render_periodic_jobs_page.py 30 | - name: Commit a PR rendered page 31 | uses: peter-evans/create-pull-request@v3 32 | with: 33 | author: kubeinit-bot 34 | committer: kubeinit-bot 35 | commit-message: "ci: Re-build periodic_jobs.md" 36 | title: "ci: re-build periodic_jobs.md" 37 | body: This commit updates the period jobs page 38 | branch: update-periodic-jobs-md 39 | base: main 40 | delete-branch: true 41 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: stale 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | strategy: 10 | max-parallel: 4 11 | matrix: 12 | python-version: [3.9] 13 | steps: 14 | - uses: actions/stale@v3 15 | with: 16 | repo-token: ${{ secrets.GITHUB_TOKEN }} 17 | stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' 18 | days-before-stale: 30 19 | days-before-close: 5 20 | exempt-issue-labels: 'awaiting-approval,work-in-progress,wip,keep' 21 | -------------------------------------------------------------------------------- /.github/workflows/units.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: units 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'docs/**' 7 | pull_request: 8 | # Run the functional tests every 8 hours. 9 | # This will help to identify faster if 10 | # there is a CI failure related to a 11 | # change in any dependency. 12 | schedule: 13 | - cron: '0 */8 * * *' 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | strategy: 18 | max-parallel: 4 19 | matrix: 20 | python-version: [3.9] 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Set up Python ${{ matrix.python-version }} 24 | uses: actions/setup-python@v1 25 | with: 26 | python-version: ${{ matrix.python-version }} 27 | - name: Install dependencies 28 | run: | 29 | sudo apt update -y 30 | sudo apt install jq -y 31 | sudo apt-get remove ansible -y 32 | sudo locale-gen en_US.UTF-8 33 | sudo dpkg-reconfigure locales 34 | sudo apt install build-essential findutils -y 35 | sudo apt-get --purge autoremove python3-pip 36 | sudo apt install python3-pip 37 | sudo python3 -m pip uninstall ansible ansible-base ansible-core -y 38 | sudo python3 -m pip install -r test-requirements.txt 39 | sudo python3 -m pip install --upgrade --ignore-installed PyYAML 40 | sudo python3 -m pip install --upgrade pip 41 | sudo python3 -m pip install --upgrade virtualenv 42 | sudo python3 -m pip install --upgrade setuptools 43 | - name: Run unit tests 44 | run: | 45 | tox -e units 46 | - uses: actions/upload-artifact@v1 47 | with: 48 | name: Unit tests result 49 | path: /home/runner/units_report.html 50 | if-no-files-found: error 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | nohup.out 2 | *.pyc 3 | *pystol.egg-info* 4 | .tox 5 | .tox/* 6 | */node_modules/* 7 | *env-config.js* 8 | releases/* 9 | kubeinit/playbooks/buffer 10 | kubeinit/playbooks/buffer/* 11 | 12 | # Byte-compiled / optimized / DLL files 13 | __pycache__/ 14 | *.py[cod] 15 | *$py.class 16 | 17 | # C extensions 18 | *.so 19 | 20 | ci/test.py 21 | 22 | # Distribution / packaging 23 | .Python 24 | build/ 25 | develop-eggs/ 26 | dist/ 27 | downloads/ 28 | eggs/ 29 | .eggs/ 30 | lib/ 31 | lib64/ 32 | parts/ 33 | sdist/ 34 | var/ 35 | wheels/ 36 | pip-wheel-metadata/ 37 | share/python-wheels/ 38 | *.egg-info/ 39 | .installed.cfg 40 | *.egg 41 | MANIFEST 42 | 43 | # PyInstaller 44 | # Usually these files are written by a python script from a template 45 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 46 | *.manifest 47 | *.spec 48 | 49 | # Installer logs 50 | pip-log.txt 51 | pip-delete-this-directory.txt 52 | 53 | # Unit test / coverage reports 54 | htmlcov/ 55 | .tox/ 56 | .nox/ 57 | .coverage 58 | .coverage.* 59 | .cache 60 | nosetests.xml 61 | coverage.xml 62 | *.cover 63 | *.py,cover 64 | .hypothesis/ 65 | .pytest_cache/ 66 | 67 | # Translations 68 | *.mo 69 | *.pot 70 | 71 | # Django stuff: 72 | *.log 73 | local_settings.py 74 | db.sqlite3 75 | db.sqlite3-journal 76 | 77 | # Flask stuff: 78 | instance/ 79 | .webassets-cache 80 | 81 | # Scrapy stuff: 82 | .scrapy 83 | 84 | # Sphinx documentation 85 | docs/_build/ 86 | docs2/_build/ 87 | 88 | # PyBuilder 89 | target/ 90 | 91 | # Jupyter Notebook 92 | .ipynb_checkpoints 93 | 94 | # IPython 95 | profile_default/ 96 | ipython_config.py 97 | 98 | # pyenv 99 | .python-version 100 | 101 | # pipenv 102 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 103 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 104 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 105 | # install all needed dependencies. 106 | #Pipfile.lock 107 | 108 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 109 | __pypackages__/ 110 | 111 | # Celery stuff 112 | celerybeat-schedule 113 | celerybeat.pid 114 | 115 | # SageMath parsed files 116 | *.sage.py 117 | 118 | # Environments 119 | .env 120 | .venv 121 | env/ 122 | venv/ 123 | ENV/ 124 | env.bak/ 125 | venv.bak/ 126 | 127 | # Spyder project settings 128 | .spyderproject 129 | .spyproject 130 | 131 | # Rope project settings 132 | .ropeproject 133 | 134 | # mkdocs documentation 135 | /site 136 | 137 | # mypy 138 | .mypy_cache/ 139 | .dmypy.json 140 | dmypy.json 141 | 142 | # Pyre type checker 143 | .pyre/ 144 | 145 | kubeinit/releases* 146 | 147 | scenario_variables.yml 148 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # The scope can be: 3 | # PERIODIC: a periodic job running in kubeinit. 4 | # PR: a PR job running in kubeinit. 5 | # SUBMARINER: a PR job running in the submariner operator repository. 6 | 7 | run-singlenode: 8 | image: fedora 9 | tags: 10 | - kubeinit-ci-singlenode 11 | script: 12 | - echo "./ci/gitlab_ci_trigger.sh singlenode ${JOB_TYPE} ${JOB_LABEL}" 13 | - ./ci/gitlab_ci_trigger.sh singlenode ${JOB_TYPE} ${JOB_LABEL} 14 | only: 15 | variables: 16 | - $CLUSTER_TYPE == "singlenode" 17 | 18 | run-multinode: 19 | image: fedora 20 | tags: 21 | - kubeinit-ci-multinode 22 | script: 23 | - echo "./ci/gitlab_ci_trigger.sh multinode ${JOB_TYPE} ${JOB_LABEL}" 24 | - ./ci/gitlab_ci_trigger.sh multinode ${JOB_TYPE} ${JOB_LABEL} 25 | only: 26 | variables: 27 | - $CLUSTER_TYPE == "multinode" 28 | 29 | merge-request: 30 | stage: test 31 | rules: 32 | - if: $CI_PIPELINE_SOURCE == "merge_request_event" 33 | tags: 34 | - kubeinit-merge-request 35 | script: 36 | - echo "bash -x ./ci/gitlab_merge_request.sh" 37 | - bash -x ./ci/gitlab_merge_request.sh 38 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | yaml-files: 4 | - '*.yaml' 5 | - '*.yml' 6 | - '.yamllint' 7 | 8 | rules: 9 | braces: enable 10 | brackets: enable 11 | colons: enable 12 | commas: enable 13 | comments: 14 | level: warning 15 | comments-indentation: 16 | level: warning 17 | document-end: disable 18 | document-start: 19 | level: warning 20 | empty-lines: enable 21 | empty-values: disable 22 | hyphens: enable 23 | indentation: 24 | level: warning 25 | indent-sequences: consistent 26 | key-duplicates: enable 27 | key-ordering: disable 28 | line-length: disable 29 | new-line-at-end-of-file: enable 30 | new-lines: enable 31 | octal-values: disable 32 | quoted-strings: disable 33 | trailing-spaces: enable 34 | truthy: disable 35 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream9 2 | 3 | LABEL maintainer="Carlos Camacho " 4 | LABEL quay.expires-after=30w 5 | 6 | ENV ANSIBLE_GATHERING smart 7 | ENV ANSIBLE_HOST_KEY_CHECKING false 8 | ENV ANSIBLE_RETRY_FILES_ENABLED false 9 | ENV ANSIBLE_SSH_PIPELINING true 10 | 11 | ENV LANG en_US.UTF-8 12 | ENV LC_ALL en_US.UTF-8 13 | 14 | ENTRYPOINT ["ansible-playbook", "-e", "kubeinit_container_run=true"] 15 | 16 | RUN set -x && \ 17 | \ 18 | echo "==> Configuring locales..." && \ 19 | dnf install -y glibc-langpack-en langpacks-en -y 20 | 21 | RUN set -x && \ 22 | \ 23 | echo "==> Installing pacakges repo dependencies..." && \ 24 | curl -L -o /etc/yum.repos.d/kubeinit.repo https://download.opensuse.org/repositories/home:/kubeinit/CentOS_9_Stream/home:kubeinit.repo && \ 25 | echo "priority=1" >> /etc/yum.repos.d/kubeinit.repo && \ 26 | echo "module_hotfixes=1" >> /etc/yum.repos.d/kubeinit.repo && \ 27 | dnf --noplugins update -y && rm -rf /var/cache/yum && \ 28 | dnf upgrade -y && dnf clean all 29 | 30 | RUN set -x && \ 31 | \ 32 | echo "==> Installing packages dependencies..." && \ 33 | dnf --noplugins install -y python python-pip openssh-clients podman jq && rm -rf /var/cache/yum && \ 34 | python3 -m pip install --user --upgrade netaddr && rm -rf /var/cache/yum && \ 35 | dnf upgrade -y && dnf clean all 36 | 37 | ARG USER=kiuser 38 | ARG UID=1001 39 | ARG HOME=/home/$USER 40 | 41 | RUN set -x && \ 42 | \ 43 | echo "==> Creating local user account..." && \ 44 | useradd --create-home --uid $UID --gid 0 $USER && \ 45 | ln -s $HOME/kubeinit/ /kubeinit 46 | 47 | WORKDIR $HOME/kubeinit 48 | 49 | RUN chown -R ${USER}:0 $HOME 50 | 51 | USER $USER 52 | 53 | ENV PATH $HOME/.local/bin:$PATH 54 | 55 | RUN set -x && \ 56 | \ 57 | echo "==> Adding ansible and dependencies..." && \ 58 | python3 -m pip install --user --upgrade pip && \ 59 | python3 -m pip install --user --upgrade cryptography && \ 60 | python3 -m pip install --user --upgrade wheel && \ 61 | python3 -m pip install --user --upgrade ansible && \ 62 | python3 -m pip install --user --upgrade shyaml netaddr ipython dnspython 63 | 64 | COPY --chown=${USER}:0 . . 65 | 66 | RUN set -x && \ 67 | \ 68 | echo "==> Installing KubeInit..." && \ 69 | ansible-playbook -vv kubeinit/build-container-playbook.yml 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | kubeinit/README.md -------------------------------------------------------------------------------- /_skeleton_role_/README.md.j2: -------------------------------------------------------------------------------- 1 | Please, refer to the {{ role_name }} role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-{{ role_name }}.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /_skeleton_role_/defaults/main.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "{{ role_name | replace('kubeinit-', '') | replace('-', '_') }}_" 21 | {{ role_name | replace('kubeinit-', '') | replace('-', '_') }}_debug: {% raw %}"{{ (ansible_verbosity | int) >= 2 | bool }}"{% endraw %} 22 | 23 | {{ role_name | replace('kubeinit-', '') | replace('-', '_') }}_hide_sensitive_logs: true 24 | -------------------------------------------------------------------------------- /_skeleton_role_/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/_skeleton_role_/files/.gitkeep -------------------------------------------------------------------------------- /_skeleton_role_/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /_skeleton_role_/meta/main.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: {{ role_name }} 21 | namespace: kubeinit 22 | description: KubeInit Role -- {{ role_name }} 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /_skeleton_role_/molecule/default/converge.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "{{ role_name }}" 22 | tasks: 23 | - name: Message for "{{ role_name }}" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "{{ role_name }}" 26 | -------------------------------------------------------------------------------- /_skeleton_role_/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /_skeleton_role_/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /_skeleton_role_/tasks/main.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # 19 | # "{{ role_name }}" tasks 20 | # 21 | -------------------------------------------------------------------------------- /_skeleton_role_/vars/main.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "{{ role_name | replace('kubeinit-', '') | replace('-', '_') }}_" 23 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | #callbacks_enabled=ansible.posix.profile_tasks 3 | localhost_warning=false 4 | show_task_path_on_failure=true 5 | #stdout_callback=community.general.diy 6 | 7 | [callback_profile_tasks] 8 | task_output_limit = 3 9 | 10 | [callback_diy] 11 | -------------------------------------------------------------------------------- /ci/README.md: -------------------------------------------------------------------------------- 1 | # Required variables 2 | 3 | Configure in your GitLab CI/CD settings the following variables: 4 | 5 | * VARS_FILE 6 | 7 | A file with extra variables to be used 8 | 9 | * GH_TOKEN 10 | 11 | The GitLab token to trigger the pipelines job. 12 | 13 | * CI_PIPELINE_URL 14 | 15 | The pipeline URL, like: https://gitlab.com/kubeinit/kubeinit-ci/pipelines/ 16 | 17 | # How to run: 18 | 19 | Create a CI/CD schedule i.e.: 20 | 21 | * Description: Cron to check for new PRs 22 | * Interval Pattern: Custom ( Cron syntax ) */15 * * * * 23 | * Cron Timezone: UTC 24 | * Target Branch: master 25 | * Activated: Active 26 | 27 | Add the `kubeinit-ci-bot` tag to the runners that 28 | will run the jobs. 29 | -------------------------------------------------------------------------------- /ci/check_collection_deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o pipefail 3 | set -ex 4 | 5 | ############################################################################# 6 | # # 7 | # Copyright kubeinit contributors. # 8 | # # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # 10 | # not use this file except in compliance with the License. You may obtain # 11 | # a copy of the License at: # 12 | # # 13 | # http://www.apache.org/licenses/LICENSE-2.0 # 14 | # # 15 | # Unless required by applicable law or agreed to in writing, software # 16 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # 17 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # 18 | # License for the specific language governing permissions and limitations # 19 | # under the License. # 20 | # # 21 | ############################################################################# 22 | 23 | read-0() { 24 | while [ "$1" ]; do 25 | IFS=$'\0' read -r -d '' "$1" || return 1 26 | shift 27 | done 28 | } && 29 | cat kubeinit/galaxy.yml | shyaml key-values-0 dependencies | 30 | while read-0 key value; do 31 | fval=$(echo "${value}" | tr -d '=') 32 | sval=$(cat kubeinit/requirements.yml | shyaml get-value collections | grep -A1 ${key} | grep -v ${key} | cut -d ':' -f 2 | tr -d ' ') 33 | if [ "$fval" = "$sval" ]; then 34 | echo "Versions for ${key} are the same in requirements.yml and galaxy.yml" 35 | else 36 | echo "For the ${key} dependency there is a mismatch in" 37 | echo "/kubeinit/kubeinit/requirements.yml and /kubeinit/kubeinit/galaxy.yml" 38 | echo "Both versions should be the same" 39 | exit 1 40 | fi 41 | done 42 | -------------------------------------------------------------------------------- /ci/check_labels_consistency.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Copyright kubeinit contributors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | not use this file except in compliance with the License. You may obtain 8 | a copy of the License at: 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | License for the specific language governing permissions and limitations 16 | under the License. 17 | """ 18 | 19 | import re 20 | 21 | from kubeinit_ci_utils import get_periodic_jobs_labels 22 | 23 | import requests 24 | 25 | url = 'https://api.github.com/repos/kubeinit/kubeinit/labels' 26 | 27 | params = dict( 28 | page=1, 29 | per_page=100 30 | ) 31 | 32 | resp = requests.get(url=url, params=params) 33 | data = resp.json() 34 | github_public_labels = [] 35 | for label in data: 36 | label_name = label['name'] 37 | if re.match(r"[a-z|0-9|\.]+-[a-z]+-[0-9]-[0-9]-[0-9]-[c|h]", 38 | label_name): 39 | github_public_labels.append(label_name) 40 | 41 | print("'check_labels_consistency.py' ==> Pull labels list from the periodic jobs definition") 42 | ci_labels = get_periodic_jobs_labels() 43 | 44 | github_public_labels.sort() 45 | ci_labels.sort() 46 | 47 | if (github_public_labels == ci_labels): 48 | print("Both CI labels list match") 49 | else: 50 | print("'check_labels_consistency.py' ==> There is a mismatch between the labels tested in the periodic jobs") 51 | print("'check_labels_consistency.py' ==> and the available GitHub labels for running the CI jobs.") 52 | print("'check_labels_consistency.py' ==> the difference is:") 53 | print(set(github_public_labels).symmetric_difference(set(ci_labels))) 54 | raise Exception("'check_labels_consistency.py' ==> STOP!") 55 | -------------------------------------------------------------------------------- /ci/check_open_build_service.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | """ 4 | Copyright kubeinit contributors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | not use this file except in compliance with the License. You may obtain 8 | a copy of the License at: 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | License for the specific language governing permissions and limitations 16 | under the License. 17 | """ 18 | 19 | import os 20 | import sys 21 | import xml.etree.ElementTree as ETree 22 | 23 | import requests 24 | 25 | user = os.environ.get("OPEN_BUILD_SERVICE_USER") 26 | password = os.environ.get("OPEN_BUILD_SERVICE_PASSWORD") 27 | url = "https://api.opensuse.org/build/home:kubeinit/_result" 28 | r = requests.get(url, auth=(user, password)) 29 | build_status = r.text 30 | print(build_status) 31 | if str(r.status_code) != "200": 32 | sys.exit('FATAL: This should return a 200') 33 | tree = ETree.fromstring(build_status) 34 | newsitems = [] 35 | for item in tree.findall('./result'): 36 | for child in item: 37 | if child.attrib['code'] == 'succeeded': 38 | print('The package: ' + child.attrib['package'] + " is OK") 39 | elif child.attrib['code'] == 'excluded': 40 | print('The package: ' + child.attrib['package'] + " is excluded") 41 | else: 42 | print('ERROR: Check!!! -- https://build.opensuse.org/project/monitor/home:kubeinit --') 43 | print(item.attrib['project']) 44 | print(item.attrib['repository']) 45 | print(item.attrib['arch']) 46 | print(item.attrib['code']) 47 | print(item.attrib['state']) 48 | print(child.attrib['package']) 49 | print(child.attrib['code']) 50 | sys.exit('FATAL') 51 | -------------------------------------------------------------------------------- /ci/gitlab_check_new_labels.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o pipefail 3 | set -ex 4 | 5 | ############################################################################# 6 | # # 7 | # Copyright kubeinit contributors. # 8 | # # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # 10 | # not use this file except in compliance with the License. You may obtain # 11 | # a copy of the License at: # 12 | # # 13 | # http://www.apache.org/licenses/LICENSE-2.0 # 14 | # # 15 | # Unless required by applicable law or agreed to in writing, software # 16 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # 17 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # 18 | # License for the specific language governing permissions and limitations # 19 | # under the License. # 20 | # # 21 | ############################################################################# 22 | 23 | echo Checking Merge Requests for new labels 24 | -------------------------------------------------------------------------------- /ci/periodic_jobs.md.j2: -------------------------------------------------------------------------------- 1 | 8 | 9 |

10 | The KUBErnetes INITiator 11 |

12 | 13 | # Periodic jobs status 14 | 15 | | Distribution | Label/Status | Driver | Controllers | Computes | Hypervisors | Launch from | 16 | |------------------|---------------|------------------|-------------------|-------------------|-----------------------|-----------------------| 17 | {%- for job in jobs %} 18 | | {{ job.distro }} | {{ job.url }} | {{ job.driver }} | {{ job.masters }} | {{ job.workers }} | {{ job.hypervisors }} | {{ job.launch_from }} | 19 | {%- endfor %} 20 | 21 | The content of this page is rendered from each job label defined 22 | in [get_periodic_jobs_labels](https://github.com/Kubeinit/kubeinit/blob/main/ci/kubeinit_ci_utils.py#L146) and 23 | processed in the 24 | [render_periodic_jobs_page.py](https://github.com/Kubeinit/kubeinit/blob/main/ci/render_periodic_jobs_page.py) script. 25 | After every merge, changes to this file will be verified by the 26 | [render_periodic_jobs_status_page](https://github.com/Kubeinit/kubeinit/blob/main/.github/workflows/render_periodic_jobs_status_page.yml) 27 | job, if there are changes, a new PR will be pushed automatically. 28 | -------------------------------------------------------------------------------- /ci/sanity.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | ############################################################################# 5 | # # 6 | # Copyright kubeinit contributors. # 7 | # # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # 9 | # not use this file except in compliance with the License. You may obtain # 10 | # a copy of the License at: # 11 | # # 12 | # http://www.apache.org/licenses/LICENSE-2.0 # 13 | # # 14 | # Unless required by applicable law or agreed to in writing, software # 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # 17 | # License for the specific language governing permissions and limitations # 18 | # under the License. # 19 | # # 20 | ############################################################################# 21 | 22 | rm -rf kubeinit/releases 23 | mkdir -p kubeinit/releases 24 | cd kubeinit 25 | 26 | # Build and install the collection 27 | rm -rf ~/.ansible/collections/ansible_collections/kubeinit/kubeinit 28 | ansible-galaxy collection build -v --force --output-path releases/ 29 | ansible-galaxy collection install --force --force-with-deps releases/kubeinit-kubeinit-`cat galaxy.yml | shyaml get-value version`.tar.gz 30 | cp galaxy.yml ~/.ansible/collections/ansible_collections/kubeinit/kubeinit/ 31 | cd ~/.ansible/collections/ansible_collections/kubeinit/kubeinit 32 | 33 | export HOME=$(eval echo ~$USER) 34 | 35 | ansible-test sanity \ 36 | --skip-test ansible-doc \ 37 | --skip-test validate-modules \ 38 | --skip-test pylint \ 39 | --skip-test future-import-boilerplate \ 40 | --skip-test shebang \ 41 | --skip-test metaclass-boilerplate \ 42 | -v --docker --python 3.9 43 | -------------------------------------------------------------------------------- /ci/units.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | ############################################################################# 5 | # # 6 | # Copyright kubeinit contributors. # 7 | # # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # 9 | # not use this file except in compliance with the License. You may obtain # 10 | # a copy of the License at: # 11 | # # 12 | # http://www.apache.org/licenses/LICENSE-2.0 # 13 | # # 14 | # Unless required by applicable law or agreed to in writing, software # 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # 17 | # License for the specific language governing permissions and limitations # 18 | # under the License. # 19 | # # 20 | ############################################################################# 21 | 22 | rm -rf kubeinit/releases 23 | mkdir -p kubeinit/releases 24 | cd kubeinit 25 | 26 | # Build and install the collection 27 | rm -rf ~/.ansible/collections/ansible_collections/kubeinit/kubeinit 28 | ansible-galaxy collection build -v --force --output-path releases/ 29 | ansible-galaxy collection install --force --force-with-deps releases/kubeinit-kubeinit-`cat galaxy.yml | shyaml get-value version`.tar.gz 30 | cp galaxy.yml ~/.ansible/collections/ansible_collections/kubeinit/kubeinit/ 31 | cd ~/.ansible/collections/ansible_collections/kubeinit/kubeinit 32 | 33 | export HOME=$(eval echo ~$USER) 34 | 35 | pytest -r a --html=~/units_report.html --self-contained-html --color yes ../kubeinit/tests/unit -vvv 36 | -------------------------------------------------------------------------------- /ci/yamlfind.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | ############################################################################# 5 | # # 6 | # Copyright kubeinit contributors. # 7 | # # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # 9 | # not use this file except in compliance with the License. You may obtain # 10 | # a copy of the License at: # 11 | # # 12 | # http://www.apache.org/licenses/LICENSE-2.0 # 13 | # # 14 | # Unless required by applicable law or agreed to in writing, software # 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # 17 | # License for the specific language governing permissions and limitations # 18 | # under the License. # 19 | # # 20 | ############################################################################# 21 | 22 | count=`find . -not -wholename "*/node_modules/*" -and -not -wholename "*.tox/*" -and -name "*.yaml" | wc -l` 23 | if [ "$count" != "0" ]; then 24 | echo "yaml extension not allowed" 25 | exit 1 26 | else 27 | echo "no yaml found" 28 | fi 29 | 30 | 31 | # Match both docs and modules/roles 32 | 33 | roles_docs_number=`ls docs/src/roles | grep -v pycache | wc -l` 34 | roles_readmes_number=`find kubeinit/roles/ -name README.md | grep -v pycache | wc -l` 35 | roles_number=`ls kubeinit/roles/ | grep -v pycache | wc -l` 36 | 37 | modules_docs_number=`ls docs/src/modules | grep -v pycache | wc -l` 38 | modules_number=`ls kubeinit/plugins/modules/ | grep -v pycache | wc -l` 39 | 40 | echo "Roles in docs: $roles_docs_number" 41 | echo "Roles: $roles_number" 42 | echo "Roles READMEs: $roles_readmes_number" 43 | 44 | echo "Modules in docs: $modules_docs_number" 45 | echo "Modules: $modules_number" 46 | 47 | if [ "$roles_readmes_number" -ne "$roles_number" ];then 48 | echo "The README.md file in each role do not"; 49 | echo "match with the number of existing roles"; 50 | exit 1; 51 | fi 52 | 53 | if [ "$roles_docs_number" -ne "$roles_number" ];then 54 | echo "Links in the roles docs section"; 55 | echo "do not match with the number of existing roles"; 56 | exit 1; 57 | fi 58 | 59 | if [ "$modules_docs_number" -ne "$modules_number" ];then 60 | echo "Links in the modules docs section"; 61 | echo "do not match with the number of existing modules"; 62 | exit 1; 63 | fi 64 | -------------------------------------------------------------------------------- /conftest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: UTF-8 -*- 3 | 4 | """ 5 | Licensed under the Apache License, Version 2.0 (the "License"). 6 | 7 | You may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 15 | implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | """ 19 | 20 | 21 | def pytest_addoption(parser): 22 | """Add the extra arguments.""" 23 | parser.addoption('--scenario', help='scenario setting') 24 | parser.addoption('--ansible-args', 25 | help='ansible args passed into test runner.') 26 | -------------------------------------------------------------------------------- /docs/src/.gitignore: -------------------------------------------------------------------------------- 1 | _build/* 2 | -------------------------------------------------------------------------------- /docs/src/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/src/README.md: -------------------------------------------------------------------------------- 1 | # Instructions for local testing 2 | 3 | Install the collection by: 4 | 5 | ``` 6 | # Assumming KubeInit is in the home directory 7 | 8 | cd 9 | cd kubeinit 10 | rm -rf releases 11 | mkdir -p releases 12 | ansible-galaxy collection build kubeinit --verbose --force --output-path releases/ 13 | cd releases 14 | LATEST=$(ls kubeinit-kubeinit*.tar.gz | grep -v latest | sort -V | tail -n1) 15 | ln -sf $LATEST kubeinit-kubeinit-latest.tar.gz 16 | ansible-galaxy collection install --force kubeinit-kubeinit-latest.tar.gz 17 | cd 18 | ``` 19 | 20 | Then proceed to render the page: 21 | 22 | ``` 23 | sudo pip3 install --upgrade pip 24 | sudo pip3 install --upgrade virtualenv 25 | sudo pip3 install --upgrade setuptools 26 | sudo pip3 install --upgrade ansible 27 | sudo pip3 install --upgrade markdown 28 | sudo pip3 install --upgrade ruamel.yaml 29 | sudo pip3 install --upgrade sphinx-rtd-theme 30 | sudo dnf install -y python3-sphinx 31 | # Build the docs 32 | cd docs/src 33 | make html 34 | open _build/html/index.html 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/src/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% block sidebartitle %} 4 | 5 | {% if logo and theme_logo_only %} 6 | 7 | {% else %} 8 | {{ project }} 9 | {% endif %} 10 | 11 | {% if logo %} 12 | {# Not strictly valid HTML, but it's the only way to display/scale 13 | it properly, without weird scripting or heaps of work 14 | #} 15 | 16 | {% endif %} 17 | 18 | 19 | {% if theme_display_version %} 20 | {%- set nav_version = version %} 21 | {% if READTHEDOCS and current_version %} 22 | {%- set nav_version = current_version %} 23 | {% endif %} 24 | {% if nav_version %} 25 |
26 | {{ nav_version }} 27 |
28 | {% endif %} 29 | {% endif %} 30 | 31 | {% include "searchbox.html" %} 32 | 33 | {% endblock %} 34 | -------------------------------------------------------------------------------- /docs/src/changelog.rst: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | -------------------------------------------------------------------------------- /docs/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/favicon.ico -------------------------------------------------------------------------------- /docs/src/howtos_and_presentations.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | HowTo's and presentations 3 | ========================= 4 | 5 | Here it is maintained a log with 6 | all the project's how-to guides and presentations. 7 | 8 | HowTo's 9 | ~~~~~~~ 10 | 11 | - `The easiest and fastest way to deploy an OKD 4.5 cluster in a Libvirt/KVM Host `_. 12 | - `KubeInit external access for OpenShift/OKD deployments with Libvirt `_. 13 | - `Persistent Volumes And Claims In KubeInit `_. 14 | - `Deploying Multiple KubeInit Clusters In The Same Hypervisor `_. 15 | - `KubeInit 4-In-1 - Deploying Multiple Kubernetes Distributions (K8S, OKD, RKE, And CDK) With The Same Platform `_. 16 | 17 | Presentations 18 | ~~~~~~~~~~~~~ 19 | 20 | - `KubeInit: Inheriting good practices from the OpenStack ecosystem to improve the way we deploy OKD/OpenShift `_ `Slides `_. 21 | -------------------------------------------------------------------------------- /docs/src/images/mingrammer/.gitignore: -------------------------------------------------------------------------------- 1 | *.png 2 | *.jpg 3 | !resources/*.png 4 | -------------------------------------------------------------------------------- /docs/src/images/mingrammer/README.md: -------------------------------------------------------------------------------- 1 | # How to render 2 | 3 | ``` 4 | python3 -m pip install diagrams 5 | python3 6 | ``` 7 | -------------------------------------------------------------------------------- /docs/src/images/mingrammer/nodes_architecture.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | """ 4 | Copyright kubeinit contributors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | not use this file except in compliance with the License. You may obtain 8 | a copy of the License at: 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | License for the specific language governing permissions and limitations 16 | under the License. 17 | """ 18 | 19 | import os 20 | 21 | from diagrams import Cluster, Diagram, Edge 22 | from diagrams.onprem.aggregator import Fluentd 23 | from diagrams.onprem.analytics import Spark 24 | from diagrams.onprem.compute import Server 25 | from diagrams.onprem.database import PostgreSQL 26 | from diagrams.onprem.inmemory import Redis 27 | from diagrams.onprem.monitoring import Grafana, Prometheus 28 | from diagrams.onprem.network import Nginx 29 | from diagrams.onprem.queue import Kafka 30 | 31 | filename = os.path.splitext(os.path.basename(__file__))[0] 32 | title = "Architectural nodes design" 33 | direction = 'LR' 34 | graph_attr = { 35 | "pad": "0" 36 | } 37 | 38 | with Diagram(title, filename=filename, graph_attr=graph_attr, outformat='png', direction=direction, show=False): 39 | ingress = Nginx("ingress") 40 | 41 | metrics = Prometheus("metric") 42 | metrics << Edge(color="firebrick", style="dashed") << Grafana("monitoring") 43 | 44 | with Cluster("Service Cluster"): 45 | grpcsvc = [ 46 | Server("grpc1"), 47 | Server("grpc2"), 48 | Server("grpc3")] 49 | 50 | with Cluster("Sessions HA"): 51 | primary = Redis("session") 52 | primary - Edge(color="brown", style="dashed") - Redis("replica") << Edge(label="collect") << metrics 53 | grpcsvc >> Edge(color="brown") >> primary 54 | 55 | with Cluster("Database HA"): 56 | primary = PostgreSQL("users") 57 | primary - Edge(color="brown", style="dotted") - PostgreSQL("replica") << Edge(label="collect") << metrics 58 | grpcsvc >> Edge(color="black") >> primary 59 | 60 | aggregator = Fluentd("logging") 61 | aggregator >> Edge(label="parse") >> Kafka("stream") >> Edge(color="black", style="bold") >> Spark("analytics") 62 | 63 | ingress >> Edge(color="darkgreen") << grpcsvc >> Edge(color="darkorange") >> aggregator 64 | -------------------------------------------------------------------------------- /docs/src/images/mingrammer/resources/kubeinit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/images/mingrammer/resources/kubeinit.png -------------------------------------------------------------------------------- /docs/src/images/mingrammer/resources/libvirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/images/mingrammer/resources/libvirt.png -------------------------------------------------------------------------------- /docs/src/images/mingrammer/resources/ovn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/images/mingrammer/resources/ovn.png -------------------------------------------------------------------------------- /docs/src/images/plantuml/.gitignore: -------------------------------------------------------------------------------- 1 | *.png 2 | *.jpg 3 | *.render 4 | -------------------------------------------------------------------------------- /docs/src/images/plantuml/github_workflow.plantuml: -------------------------------------------------------------------------------- 1 | /' 2 | Copyright kubeinit contributors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | not use this file except in compliance with the License. You may obtain 6 | a copy of the License at: 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | License for the specific language governing permissions and limitations 14 | under the License. 15 | '/ 16 | 17 | @startuml 18 | actor RootUser 19 | control GitLab_Schedule 20 | 21 | RootUser [bold,#blue]-> GitHub_PR : Add CI label 22 | GitLab_Schedule [bold,#LightSeaGreen]-> GitLab_Schedule: Runs every 15 minutes 23 | GitLab_Schedule [bold,#green]-> GitHub_PR : Get labels from open PRs 24 | GitHub_PR [bold,#green]-> GitLab_Schedule: Send labels for open PRs 25 | 26 | Loop for each label 27 | GitLab_Schedule [bold,#green]-> GitHub_PR : Remove label 28 | GitLab_Schedule [bold,#green]-> GitHub_PR : Mark label as a "in progress job" 29 | GitLab_Schedule [bold,#green]-> GitLab_Runner : Trigger job 30 | GitLab_Runner [bold,#red]-> GitLab_Runner : Configure job parameters based in the label information 31 | GitLab_Runner [bold,#purple]-> Worker_machines : Deploy the cluster 32 | Worker_machines [bold,#purple]-> GitLab_Runner : Send the job result 33 | GitLab_Runner [bold,#green]-> GitHub_PR : Write the job result in the PR 34 | GitLab_Runner [bold,#green]-> GitHub_PR : Mark the job as finished (successfully or with failures) 35 | End 36 | 37 | GitHub_PR [bold,#blue]-> RootUser: Done 38 | 39 | legend 40 | |= Color |= Type |= Description | 41 | | | <&arrow-right> | User action triggered by an elevated KubeInit member. | 42 | | | <&arrow-right> | GitLab native scheduled job. | 43 | | | <&arrow-right> | The ci/launch_e2e.py script located in the kubeinit repository.| 44 | | | <&arrow-right> | The ci/run.sh script located in the kubeinit repository.| 45 | | | <&arrow-right> | Execution of the KubeInit's Ansible collection| 46 | endlegend 47 | @enduml 48 | -------------------------------------------------------------------------------- /docs/src/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to KubeInit's documentation! 2 | ==================================== 3 | 4 | KubeInit provides Ansible playbooks and roles for the deployment 5 | and configuration of multiple Kubernetes distributions. 6 | 7 | Community 8 | ~~~~~~~~~ 9 | 10 | The `source code of Kubeinit `_ 11 | is hosted on GitHub. 12 | 13 | For issue reports please use the GitHub 14 | `Kubeinit issue tracker `_. 15 | 16 | To get help, feel free to also create an 17 | `issue `_ 18 | on GitHub with your question. 19 | 20 | For a more interactive chat, join the the channel 21 | `#kubeinit `_. 22 | 23 | If you want to contribute to the project (code, docs, ...), please 24 | refer to the `contributing docs `_. 25 | 26 | Contributors 27 | ~~~~~~~~~~~~ 28 | 29 | First thing first, thank you to all KubeInit's contributors. 30 | 31 | .. ghcontributors:: kubeinit/kubeinit 32 | :limit: 200 33 | :order: DESC 34 | :exclude: kubeinit-bot,sphinx 35 | 36 | 37 | Mission 38 | ~~~~~~~ 39 | 40 | KubeInit's mission is to have a fully automated way to deploy in a single command a curated list of 41 | prescribed architectures based on the following principles **(G.I.V.E.)**. 42 | 43 | .. raw:: html 44 | 45 |

Guide new and experienced users and contributors to deploy quickly and easily Kubernetes clusters based on a set of prescribed architectures.

46 | 47 |

Incentivate new users and contributors to overcoming the learning curve to successfully deploy complex Kubernetes scenarios.

48 | 49 |

Verify automatically that the defined prescribed architectures work seamlessly.

50 | 51 |

Engage with the upstream community for giving and receiving feedback, and cross-pollination to spark and amplify creativity, serendipity, and interdisciplinary friction.

52 | 53 | Content 54 | ~~~~~~~ 55 | 56 | .. toctree:: 57 | :maxdepth: 2 58 | 59 | usage 60 | architecture 61 | contributing 62 | roles 63 | modules 64 | howtos_and_presentations 65 | inventory_diagrams 66 | playbook_diagrams 67 | supporters 68 | changelog 69 | notice 70 | -------------------------------------------------------------------------------- /docs/src/installation.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Installation 3 | ============ 4 | -------------------------------------------------------------------------------- /docs/src/inventory_diagrams.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | Inventory diagrams 3 | ================== 4 | 5 | The following are all the supported 6 | inventory architectural diagrams. 7 | -------------------------------------------------------------------------------- /docs/src/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/src/modules.rst: -------------------------------------------------------------------------------- 1 | Documented modules in KubeInit 2 | ============================== 3 | 4 | Contents: 5 | 6 | .. toctree:: 7 | :glob: 8 | 9 | modules/* 10 | -------------------------------------------------------------------------------- /docs/src/modules/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/modules/.gitkeep -------------------------------------------------------------------------------- /docs/src/modules/module-kubeinit_package.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Module - kubeinit_package 3 | ========================= 4 | 5 | 6 | This module provides for the following ansible plugin: 7 | 8 | * kubeinit_package 9 | 10 | 11 | .. ansibleautoplugin:: 12 | :module: kubeinit/plugins/modules/package.py 13 | :documentation: true 14 | :examples: true 15 | -------------------------------------------------------------------------------- /docs/src/notice.rst: -------------------------------------------------------------------------------- 1 | ====== 2 | Notice 3 | ====== 4 | 5 | Kubeinit is and Open Source project driven by individual contributors, 6 | the scope of this upstream project is for non-commercial usage, and there is 7 | no commercial support for any of the Kubernetes distributions that can be deployed. 8 | 9 | Any trademarks and logo potentially referenced anywhere in this project is 10 | protected by Intellectual Property Rights Laws and all trademarks are the 11 | property of their respective owners. 12 | 13 | Any of the contributors of this project will not be held responsible for any damages 14 | suffered as a result of using Kubeinit. This project include steps that might 15 | damage or break production environments if they are deployed together. 16 | -------------------------------------------------------------------------------- /docs/src/playbook_diagrams.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | Playbook diagrams 3 | ================= 4 | 5 | The following are all the supported 6 | playbooks architectural diagrams. 7 | -------------------------------------------------------------------------------- /docs/src/roles.rst: -------------------------------------------------------------------------------- 1 | Documented roles in KubeInit 2 | ============================ 3 | 4 | Contents: 5 | 6 | .. toctree:: 7 | :glob: 8 | 9 | roles/* 10 | -------------------------------------------------------------------------------- /docs/src/roles/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/roles/.gitkeep -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_apache.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Role - kubeinit_apache 3 | ====================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_apache 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_bind.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | Role - kubeinit_bind 3 | ==================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_bind 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_dnsmasq.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | Role - kubeinit_dnsmasq 3 | ======================= 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_dnsmasq 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_haproxy.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | Role - kubeinit_haproxy 3 | ======================= 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_haproxy 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_k8s.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | Role - kubeinit_k8s 3 | =================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_k8s 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_libvirt.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | Role - kubeinit_libvirt 3 | ======================= 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_libvirt 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_openshift.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | Role - kubeinit_openshift 3 | =================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_openshift 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_prepare.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | Role - kubeinit_prepare 3 | ======================= 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_prepare 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_registry.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Role - kubeinit_registry 3 | ======================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_registry 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_services.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Role - kubeinit_services 3 | ======================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_services 7 | -------------------------------------------------------------------------------- /docs/src/roles/role-kubeinit_validations.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Role - kubeinit_validations 3 | =========================== 4 | 5 | .. ansibleautoplugin:: 6 | :role: kubeinit/roles/kubeinit_validations 7 | -------------------------------------------------------------------------------- /docs/src/static/css/custom.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 300%; 3 | } 4 | h2 { 5 | font-size: 200%; 6 | font-weight: 100; 7 | } 8 | h3 { 9 | font-size: 150%; 10 | font-weight: 100; 11 | } 12 | h4 { 13 | font-size: 100%; 14 | font-weight: 1000; 15 | } 16 | 17 | h4:before { 18 | content: '■ '; 19 | position: relative; 20 | bottom: .1em; 21 | color: #000; 22 | } 23 | 24 | .wy-nav-content { 25 | max-width: none; 26 | } 27 | 28 | div.leftside { 29 | width: 230px; 30 | height: 130px; 31 | padding: 0px 3px 0px 0px; 32 | float: left; 33 | } 34 | 35 | div.rightside { 36 | text-align: justify; 37 | text-justify: inter-word; 38 | } 39 | 40 | div .roledocs > .highlight { 41 | background: #fcfcfc; 42 | } 43 | 44 | div .roledocs > .highlight pre span { 45 | color: black; 46 | font-weight: normal; 47 | } 48 | 49 | div .roledocs > .highlight pre { 50 | color: black; 51 | font-weight: normal; 52 | } 53 | -------------------------------------------------------------------------------- /docs/src/static/inventory.j2: -------------------------------------------------------------------------------- 1 | digraph {{pattern|labelescape}} { 2 | {{ attributes }} 3 | 4 | {% for node in nodes|sort(attribute="name") %} 5 | {% if node.leaf %} 6 | {{ node.name|labelescape }} [shape=record style=rounded label=< 7 | 8 | 11 | {% if node.vars and showvars %}
{% endif %} 12 |
9 | {{ node.name}} 10 |
{% for var in node.vars|sort %}{% if var|is_visible %}{{var}} = {{node.vars[var]}}
{% endif %}{%endfor %}
13 | >] 14 | {% else %} 15 | {{ node.name|labelescape }} [shape=record label=< 16 | 17 | 20 | {% if node.vars and showvars %}
{% endif %} 21 |
18 | {{ node.name}} 19 |
{% for var in node.vars|sort %}{% if var|is_visible %}{{var}} = {{node.vars[var]}}
{% endif %}{%endfor %}
22 | >] 23 | {% endif %}{% endfor %} 24 | 25 | {% for edge in edges|sort(attribute='source') %} 26 | {{ edge.source|labelescape }} -> {{ edge.target|labelescape }}; 27 | {% endfor %} 28 | } 29 | -------------------------------------------------------------------------------- /docs/src/static/parsers/xhtml1-special.txt: -------------------------------------------------------------------------------- 1 | .. This data file has been placed in the public domain. 2 | .. Derived from the Unicode character mappings available from 3 | . 4 | Processed by unicode2rstsubs.py, part of Docutils: 5 | . 6 | 7 | .. |bdquo| unicode:: U+0201E .. DOUBLE LOW-9 QUOTATION MARK 8 | .. |circ| unicode:: U+002C6 .. MODIFIER LETTER CIRCUMFLEX ACCENT 9 | .. |Dagger| unicode:: U+02021 .. DOUBLE DAGGER 10 | .. |dagger| unicode:: U+02020 .. DAGGER 11 | .. |emsp| unicode:: U+02003 .. EM SPACE 12 | .. |ensp| unicode:: U+02002 .. EN SPACE 13 | .. |euro| unicode:: U+020AC .. EURO SIGN 14 | .. |gt| unicode:: U+0003E .. GREATER-THAN SIGN 15 | .. |ldquo| unicode:: U+0201C .. LEFT DOUBLE QUOTATION MARK 16 | .. |lrm| unicode:: U+0200E .. LEFT-TO-RIGHT MARK 17 | .. |lsaquo| unicode:: U+02039 .. SINGLE LEFT-POINTING ANGLE QUOTATION MARK 18 | .. |lsquo| unicode:: U+02018 .. LEFT SINGLE QUOTATION MARK 19 | .. |lt| unicode:: U+0003C .. LESS-THAN SIGN 20 | .. |mdash| unicode:: U+02014 .. EM DASH 21 | .. |ndash| unicode:: U+02013 .. EN DASH 22 | .. |OElig| unicode:: U+00152 .. LATIN CAPITAL LIGATURE OE 23 | .. |oelig| unicode:: U+00153 .. LATIN SMALL LIGATURE OE 24 | .. |permil| unicode:: U+02030 .. PER MILLE SIGN 25 | .. |quot| unicode:: U+00022 .. QUOTATION MARK 26 | .. |rdquo| unicode:: U+0201D .. RIGHT DOUBLE QUOTATION MARK 27 | .. |rlm| unicode:: U+0200F .. RIGHT-TO-LEFT MARK 28 | .. |rsaquo| unicode:: U+0203A .. SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 29 | .. |rsquo| unicode:: U+02019 .. RIGHT SINGLE QUOTATION MARK 30 | .. |sbquo| unicode:: U+0201A .. SINGLE LOW-9 QUOTATION MARK 31 | .. |Scaron| unicode:: U+00160 .. LATIN CAPITAL LETTER S WITH CARON 32 | .. |scaron| unicode:: U+00161 .. LATIN SMALL LETTER S WITH CARON 33 | .. |thinsp| unicode:: U+02009 .. THIN SPACE 34 | .. |tilde| unicode:: U+002DC .. SMALL TILDE 35 | .. |Yuml| unicode:: U+00178 .. LATIN CAPITAL LETTER Y WITH DIAERESIS 36 | .. |zwj| unicode:: U+0200D .. ZERO WIDTH JOINER 37 | .. |zwnj| unicode:: U+0200C .. ZERO WIDTH NON-JOINER 38 | -------------------------------------------------------------------------------- /docs/src/white_text_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/docs/src/white_text_logo.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/favicon.ico -------------------------------------------------------------------------------- /images/fonts/Quicksand_Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Bold.otf -------------------------------------------------------------------------------- /images/fonts/Quicksand_Bold_Oblique.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Bold_Oblique.otf -------------------------------------------------------------------------------- /images/fonts/Quicksand_Book.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Book.otf -------------------------------------------------------------------------------- /images/fonts/Quicksand_Book_Oblique.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Book_Oblique.otf -------------------------------------------------------------------------------- /images/fonts/Quicksand_Dash.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Dash.otf -------------------------------------------------------------------------------- /images/fonts/Quicksand_Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Light.otf -------------------------------------------------------------------------------- /images/fonts/Quicksand_Light_Oblique.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/fonts/Quicksand_Light_Oblique.otf -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/icon.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/images/logo.png -------------------------------------------------------------------------------- /kubeinit/build-container-playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | - name: Setup the KubeInit environment for a container 18 | hosts: localhost 19 | become: false 20 | gather_subset: "!all,network" 21 | pre_tasks: 22 | - name: Check if Ansible meets version requirements. 23 | vars: 24 | kubeinit_ansible_min_version: 2.9 25 | ansible.builtin.assert: 26 | that: "ansible_version.full is version('{{ kubeinit_ansible_min_version }}', '>=')" 27 | msg: > 28 | "You must update Ansible to at least {{ kubeinit_ansible_min_version }} to use KubeInit." 29 | tasks: 30 | - name: Install ansible-galaxy requirements 31 | community.general.ansible_galaxy_install: 32 | type: collection 33 | requirements_file: ~/kubeinit/kubeinit/requirements.yml 34 | force: true 35 | 36 | - name: Remove any existing kubeinit/kubeinit galaxy collection 37 | ansible.builtin.file: 38 | path: ~/.ansible/collections/ansible_collections/kubeinit/kubeinit 39 | state: absent 40 | 41 | - name: Build the kubeinit/kubeinit galaxy collection 42 | ansible.builtin.command: 43 | chdir: ~/kubeinit 44 | cmd: ansible-galaxy collection build kubeinit --verbose --force --output-path releases/ 45 | register: _result 46 | 47 | - name: Read the kubeinit/galaxy.xml file 48 | ansible.builtin.command: 49 | chdir: ~/kubeinit 50 | cmd: cat kubeinit/galaxy.yml 51 | register: _result 52 | 53 | - name: Set galaxy file facts 54 | ansible.builtin.set_fact: 55 | galaxy_facts: "{{ _result.stdout | from_yaml }}" 56 | 57 | - name: Install the kubeinit/kubeinit galaxy collection 58 | ansible.builtin.command: 59 | chdir: ~/kubeinit 60 | cmd: ansible-galaxy collection install --force --force-with-deps releases/kubeinit-kubeinit-{{ galaxy_facts.version }}.tar.gz 61 | register: _result 62 | failed_when: _result is not defined 63 | 64 | - name: Clean up releases folder after installing the collection 65 | ansible.builtin.file: 66 | path: ~/kubeinit/releases 67 | state: absent 68 | -------------------------------------------------------------------------------- /kubeinit/galaxy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | namespace: kubeinit 3 | name: kubeinit 4 | version: 2.2.2 5 | readme: README.md 6 | authors: 7 | - Carlos Camacho 8 | # Keep this at the bottom 9 | - kubeinit (https://github.com/kubeinit) 10 | description: KubeInit 11 | license: 12 | - Apache-2.0 13 | tags: 14 | - k8s 15 | - kubernetes 16 | - openshift 17 | - origin 18 | dependencies: 19 | ansible.posix: '==1.5.4' 20 | ansible.utils: '==5.0.0' 21 | community.crypto: '==2.21.1' 22 | community.general: '==9.2.0' 23 | community.libvirt: '==1.3.0' 24 | containers.podman: '==1.15.4' 25 | openvswitch.openvswitch: '==2.1.1' 26 | 27 | repository: 'https://github.com/kubeinit/kubeinit' 28 | homepage: 'https://www.kubeinit.org' 29 | issues: 'https://github.com/kubeinit/kubeinit/issues' 30 | -------------------------------------------------------------------------------- /kubeinit/group_vars/all.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # 4 | # Common variables 5 | # 6 | 7 | ### 8 | # Specify the Python interpreter. 9 | ansible_python_interpreter: '/usr/bin/python3' 10 | 11 | ### 12 | # Enable SSH pipelining. 13 | ansible_ssh_pipelining: True 14 | 15 | ### 16 | # Define the default SSH common arguments. 17 | ansible_ssh_common_args: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=accept-new' 18 | 19 | ### 20 | # Determine if Ansible debug is currently enabled. 21 | ansible_debug_enabled: "{{ (lookup('env','ANSIBLE_DEBUG') | bool) or false }}" 22 | 23 | ### 24 | # Number of attempts to connect. 25 | # Ansible retries connections only if it gets an SSH error with a return code of 255. 26 | # Any errors with return codes other than 255 indicate an issue with program execution. 27 | ansible_ssh_retries: 10 28 | -------------------------------------------------------------------------------- /kubeinit/group_vars/kubeinit_cluster.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | ### 4 | # The default for the cluster name is {{ kubeinit_cluster_distro + 'cluster' }} 5 | # You can override this by setting a specific value for cluster_name in the 6 | # kubeinit_cluster_spec command line variable, e.g. 7 | # -e kubeinit_cluster_spec='{"cluster_name":"mycluster"}' 8 | cluster_name_docsplaceholder: 'the variable cluster_name should be defaulted to ""' 9 | 10 | ### 11 | # The default for the cluster domain name 12 | cluster_domain: kubeinit.local 13 | 14 | ### 15 | # The default for the hypervisor naming pattern 16 | hypervisor_name_pattern: hypervisor-%02d 17 | 18 | ### 19 | # The default for the controller naming pattern 20 | controller_name_pattern: controller-%02d 21 | 22 | ### 23 | # The default for the compute naming pattern 24 | compute_name_pattern: compute-%02d 25 | -------------------------------------------------------------------------------- /kubeinit/group_vars/kubeinit_env.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # 4 | # Additional defaults that can be provided with environment vars 5 | # 6 | 7 | ### 8 | # Certificate default country. 9 | certificate_country: "{{ lookup('env','KUBEINIT_COMMON_CERTIFICATE_COUNTRY') or 'US' }}" 10 | 11 | ### 12 | # Certificate default state. 13 | certificate_state: "{{ lookup('env','KUBEINIT_COMMON_CERTIFICATE_STATE') or 'MyState' }}" 14 | 15 | ### 16 | # Certificate default locality. 17 | certificate_locality: "{{ lookup('env','KUBEINIT_COMMON_CERTIFICATE_LOCALITY') or 'MyCity' }}" 18 | 19 | ### 20 | # Certificate default organization. 21 | certificate_organization: "{{ lookup('env','KUBEINIT_COMMON_CERTIFICATE_ORGANIZATION') or 'MyCompany' }}" 22 | 23 | ### 24 | # Certificate default OU. 25 | certificate_organizational_unit: "{{ lookup('env','KUBEINIT_COMMON_CERTIFICATE_ORGANIZATIONAL_UNIT') or 'MyDepartment' }}" 26 | 27 | ### 28 | # Default public DNS. 29 | dns_public: "{{ lookup('env','KUBEINIT_COMMON_DNS_PUBLIC') or '1.1.1.1' }}" 30 | 31 | ### 32 | # Default SSH key type. 33 | ssh_keytype: "{{ lookup('env','KUBEINIT_COMMON_SSH_KEYTYPE') or 'rsa' }}" 34 | -------------------------------------------------------------------------------- /kubeinit/group_vars/kubeinit_facts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | ### 4 | # The set of kubernetes distributions supported by Kubeinit. 5 | # 6 | # - name: the formal name for the distro 7 | # - role: the role that provides the distro specific tasks. 8 | # 9 | distro_facts: 10 | k8s: 11 | name: 'Vanilla CNCF Kubernetes' 12 | role: kubeinit_k8s 13 | ocp: 14 | name: 'OpenShift Container Platform' 15 | role: kubeinit_openshift 16 | okd: 17 | name: 'Origin Distribution of Kubernetes' 18 | role: kubeinit_openshift 19 | -------------------------------------------------------------------------------- /kubeinit/group_vars/kubeinit_network.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | ### 4 | # The default for the cluster network name is kimgtnet0. 5 | # 6 | # You can override this by setting a specific value for network_name in the 7 | # kubeinit_network_spec command line variable, e.g. 8 | # -e kubeinit_network_spec='{"network_name":"mynetwork"}' 9 | # 10 | # The network name will be used to create a libvirt network for the cluster 11 | # guest vms. The network cidr will set the range of addresses reserved for 12 | # the cluster nodes. The gateway offset will be used to select the gateway 13 | # address within the range, a negative offset starts at the end of the range, 14 | # so for network=10.0.0.0/24, gateway_offset=-2 will select 10.0.0.254 and 15 | # gateway_offset=1 will select 10.0.0.1 as the address. The other offset 16 | # attributes follow the same convention. 17 | network_name_docsplaceholder: 'the variable network_name should be defaulted to ""' 18 | 19 | ### 20 | # The default for the network CIDR 21 | network: 10.0.0.0/24 22 | 23 | ### 24 | # The default for the gateway offset 25 | gateway_offset: -2 26 | 27 | ### 28 | # The default for the DHCP start lease offset 29 | dhcp_start_offset: 1 30 | 31 | ### 32 | # The default for the DHCP end lease offset 33 | dhcp_end_offset: -3 34 | -------------------------------------------------------------------------------- /kubeinit/group_vars/kubeinit_secrets.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # 4 | # Kubeinit secrets data 5 | # 6 | 7 | ### 8 | # This variable contains, 9 | # a secret placeholder. 10 | kubeinit_secrets_secret: 11 | ### 12 | # The secret name represents 13 | # a secret placeholder. 14 | secret_name: kubeinit-secrets 15 | ### 16 | # The envvar name works for 17 | # a secret placeholder. 18 | envvar_name: KUBEINIT_SECRETS 19 | 20 | # 21 | # Nested comments in lists aren't supported yet. 22 | # 23 | 24 | ### 25 | # All the secrets will enable 26 | # the deployment capabilities, this is 27 | # a docs placeholder. 28 | # 29 | # .. code-block:: yaml 30 | # 31 | # kubeinit_secrets: 32 | # - secret_name: This is the secret name. 33 | # dict_varname: Where we will store the secret. 34 | # dict_key: The secret value. 35 | # env_varname: A default value from an environmental variable. 36 | # 37 | # The ones that are currently used: 38 | # 39 | # - kubeinit-ssh-key: Docs placeholder. 40 | # - dockerhub-username: Docs placeholder. 41 | # - dockerhub-password: Docs placeholder. 42 | # - openshift-pullsecret: Docs placeholder. 43 | kubeinit_secrets: 44 | - secret_name: kubeinit-ssh-key 45 | dict_varname: kubeinit 46 | dict_key: ssh_key 47 | envvar_name: KUBEINIT_SECRET_SSH_KEY 48 | - secret_name: dockerhub-username 49 | dict_varname: dockerhub 50 | dict_key: username 51 | envvar_name: KUBEINIT_SECRET_DOCKER_USERNAME 52 | - secret_name: dockerhub-password 53 | dict_varname: dockerhub 54 | dict_key: password 55 | envvar_name: KUBEINIT_SECRET_DOCKER_PASSWORD 56 | - secret_name: openshift-pullsecret 57 | dict_varname: openshift 58 | dict_key: pullsecret 59 | envvar_name: KUBEINIT_SECRET_OPENSHIFT_PULLSECRET 60 | -------------------------------------------------------------------------------- /kubeinit/inventory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | ### 4 | # The cluster's guest VM nodes can be distributed across mutiple hosts. By default they 5 | # will be deployed in the first Hypervisor. These hypervisors are activated and used 6 | # depending on how they are referenced in the kubeinit spec string. 7 | # 8 | # In the first example we would associate the ansible_host of the first hypervisor host 9 | # "nyctea" with the hostname provided, it can be a short or fully qualified name, but it 10 | # needs to be resolvable on the host we are running kubeinit from. The second example 11 | # uses a host ip address, which can be useful in those cases where the host you are using 12 | # doesn't have a dns name. 13 | # 14 | # Examples: 15 | # 16 | # -e hypervisor_hosts_spec='[{"host":"hypervisor-01","ansible_host":"nyctea","ssh_hostname":"server1.example.com"}]' 17 | 18 | # -e hypervisor_hosts_spec='[{"host":"hypervisor-01","ansible_host":"192.168.222.202"}]' 19 | # 20 | 21 | ### 22 | # The inventory will have one host identified as the bastion host. By default, this role will 23 | # be assumed by the first hypervisor. The first example would set the second hypervisor to be 24 | # the bastion host. The final example would set the bastion host to be a different host that 25 | # is not being used as a hypervisor for the guests VMs of the cluster. 26 | # 27 | # Examples: 28 | # 29 | # -e bastion_host_spec='{"host":"bastion","target":"hypervisor-02"}' 30 | # 31 | # -e bastion_host_spec='{"host":"bastion","ansible_host":"bastion.example.com"}' 32 | # 33 | 34 | ### 35 | # The inventory will have one host identified as the ovn-central host. By default, this role 36 | # will be assumed by the first hypervisor. The example would set the second hypervisor to be 37 | # the ovn-central host. 38 | # 39 | # Example: 40 | # 41 | # -e ovn_central_host_spec='{"host":"ovn-central","target":"hypervisor-02"}' 42 | # 43 | -------------------------------------------------------------------------------- /kubeinit/meta/runtime.yml: -------------------------------------------------------------------------------- 1 | --- 2 | requires_ansible: ">=2.9,<3.4" 3 | -------------------------------------------------------------------------------- /kubeinit/plugins/lookup/cli_args.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | """cli_args lookup plugin.""" 4 | 5 | from __future__ import (absolute_import, division, print_function) 6 | __metaclass__ = type 7 | 8 | from ansible.plugins.lookup import LookupBase 9 | 10 | try: 11 | from ansible import context 12 | except ImportError: 13 | context = False 14 | 15 | DOCUMENTATION = """ 16 | name: cli_args 17 | author: Kubeinit contributors 18 | short_description: Lookup Ansible command-line arguments 19 | description: Retrieves the values of Ansible command-line arguments 20 | options: 21 | _terms: 22 | description: The command-line arguments to look up 23 | required: True 24 | """ 25 | 26 | EXAMPLES = """ 27 | - name: Show remote_user command line argument (-u | --user ) 28 | debug: msg="{{ lookup('cli_args', 'remote_user') }}" 29 | """ 30 | 31 | RETURN = """ 32 | _raw: 33 | description: 34 | - value(s) of the arguments from the command-line 35 | type: raw 36 | """ 37 | 38 | 39 | class LookupModule(LookupBase): 40 | """Define LookupModule.""" 41 | 42 | def run(self, terms, variables=None, **kwargs): 43 | """Define run function.""" 44 | ret = [] 45 | 46 | if context: 47 | for term in terms: 48 | result = context.CLIARGS[term] 49 | ret.append(result) 50 | 51 | return ret 52 | -------------------------------------------------------------------------------- /kubeinit/plugins/module_utils/const.py: -------------------------------------------------------------------------------- 1 | """Collection constants.""" 2 | 3 | from __future__ import (absolute_import, division, print_function) 4 | __metaclass__ = type 5 | 6 | KUBEINIT_VERSION = '0.1.0' 7 | -------------------------------------------------------------------------------- /kubeinit/plugins/modules/package.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | Plugin example to be removed. 5 | 6 | This is a plugin example to be removed 7 | """ 8 | 9 | from __future__ import (absolute_import, division, print_function) 10 | __metaclass__ = type 11 | 12 | ANSIBLE_METADATA = { 13 | 'metadata_version': '1.1', 14 | 'status': ['preview'], 15 | 'supported_by': 'community' 16 | } 17 | 18 | DOCUMENTATION = ''' 19 | --- 20 | module: package 21 | 22 | short_description: Example module 23 | 24 | version_added: "2.9" 25 | 26 | author: "KubeInit (@kubeinit)" 27 | 28 | description: 29 | - "This is an example description" 30 | 31 | options: 32 | path: 33 | description: 34 | - Resources YAML file to read. 35 | required: true 36 | type: str 37 | ''' 38 | 39 | EXAMPLES = ''' 40 | - name: This is an example 41 | kubeinit.kubeinit.package: 42 | path: /opt/test/networks.yml 43 | register: read_networks 44 | 45 | - name: Debug-print resources 46 | debug: 47 | msg: "{{ read_networks.resources }}" 48 | ''' 49 | 50 | RETURN = ''' 51 | ''' 52 | 53 | 54 | from ansible.module_utils.basic import AnsibleModule 55 | 56 | 57 | def run_module(): 58 | """Execute the module.""" 59 | module_args = dict( 60 | path=dict(type='str', required=True), 61 | ) 62 | 63 | result = dict( 64 | # This module doesn't change anything. 65 | changed=False, 66 | ) 67 | 68 | module = AnsibleModule( 69 | argument_spec=module_args, 70 | supports_check_mode=True, 71 | ) 72 | 73 | result['resources'] = "test" 74 | 75 | module.exit_json(**result) 76 | 77 | 78 | def main(): 79 | """Run the main method.""" 80 | run_module() 81 | 82 | 83 | if __name__ == '__main__': 84 | main() 85 | -------------------------------------------------------------------------------- /kubeinit/requirements.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Kubeinit Ansible requirements 3 | # 4 | 5 | --- 6 | collections: 7 | - name: ansible.posix 8 | version: '1.5.4' 9 | - name: ansible.utils 10 | version: '5.0.0' 11 | - name: community.crypto 12 | version: '2.21.1' 13 | - name: community.general 14 | version: '9.2.0' 15 | - name: community.libvirt 16 | version: '1.3.0' 17 | - name: containers.podman 18 | version: '1.15.4' 19 | - name: openvswitch.openvswitch 20 | version: '2.1.1' 21 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_apache role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_apache.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_apache_" 21 | kubeinit_apache_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_apache_hide_sensitive_logs: true 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_apache/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_apache 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_apache 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_apache" 22 | tasks: 23 | - name: Message for "kubeinit_apache" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_apache" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | provisioner: 10 | name: ansible 11 | verifier: 12 | name: ansible 13 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_apache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_apache_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_bind role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_bind.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_bind_" 21 | kubeinit_bind_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_bind_hide_sensitive_logs: true 23 | 24 | kubeinit_bind_directory: /var/kubeinit/bind 25 | kubeinit_bind_directory_kubeinit: "{{ kubeinit_bind_directory }}/kubeinit" 26 | kubeinit_bind_directory_zones_internals: "{{ kubeinit_bind_directory_kubeinit }}/zones/internals" 27 | 28 | kubeinit_bind_directories: 29 | - "{{ kubeinit_bind_directory }}" 30 | - "{{ kubeinit_bind_directory_kubeinit }}" 31 | - "{{ kubeinit_bind_directory_zones_internals }}" 32 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_bind/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_bind 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_bind 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_bind" 22 | tasks: 23 | - name: Message for "kubeinit_bind" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_bind" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/templates/internals_db.j2: -------------------------------------------------------------------------------- 1 | $TTL 604800 2 | 3 | ; This file is rendered using a template from a KubeInit role 4 | ; This file will be overriden each time the playbook runs 5 | ; No not edit directly 6 | ; More information at: https://github.com/kubeinit/kubeinit 7 | 8 | {% for host in groups['all_service_nodes'] | list %} 9 | @ IN SOA {{ host }}.{{ kubeinit_cluster_fqdn }}. admin.{{ kubeinit_cluster_fqdn }}.( 10 | {% endfor %} 11 | 6 ; Serial 12 | 604800 ; Refresh 13 | 86400 ; Retry 14 | 2419200 ; Expire 15 | 604800 ; Negative Cache TTL 16 | ) 17 | 18 | ; name servers - NS records 19 | {% for host in groups['all_service_nodes'] | list %} 20 | IN NS {{ host }}.{{ kubeinit_cluster_fqdn }}. 21 | {% endfor %} 22 | 23 | ; KubeInit cluster Cluster - PTR records 24 | {% for host in groups['all_controller_nodes'] | list %} 25 | {{ hostvars[host].ansible_host.split('.')[-1] }} IN PTR master{{ loop.index - 1 }}.{{ kubeinit_cluster_fqdn }}. 26 | {% endfor %} 27 | 28 | {% for host in groups['all_compute_nodes'] | default([]) | list %} 29 | {{ hostvars[host].ansible_host.split('.')[-1] }} IN PTR worker{{ loop.index - 1 }}.{{ kubeinit_cluster_fqdn }}. 30 | {% endfor %} 31 | 32 | {% for host in groups['all_extra_nodes'] | default([]) | list %} 33 | {{ hostvars[host].ansible_host.split('.')[-1] }} IN PTR {{ host }}.{{ kubeinit_cluster_fqdn }}. 34 | {% endfor %} 35 | 36 | {% for host in groups['all_service_nodes'] | list %} 37 | {{ hostvars[host].ansible_host.split('.')[-1] }} IN PTR {{ host }}.{{ kubeinit_cluster_fqdn }}. 38 | {{ hostvars[host].ansible_host.split('.')[-1] }} IN PTR api.{{ kubeinit_cluster_fqdn }}. 39 | {{ hostvars[host].ansible_host.split('.')[-1] }} IN PTR api-int.{{ kubeinit_cluster_fqdn }}. 40 | {% endfor %} 41 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/templates/named.conf.j2: -------------------------------------------------------------------------------- 1 | /* This file is rendered using a template from a KubeInit role */ 2 | /* This file will be overriden each time the playbook runs */ 3 | /* No not edit directly */ 4 | /* More information at: https://github.com/kubeinit/kubeinit */ 5 | 6 | options { 7 | listen-on port 53 { 127.0.0.1; {{ kubeinit_bind_service_address }}; }; 8 | 9 | directory "/var/cache/bind"; 10 | 11 | allow-query { localhost; {{ kubeinit_bind_service_address | ipsubnet(24) }}; }; 12 | 13 | recursion yes; 14 | allow-recursion { any; }; 15 | 16 | forwarders { 17 | {{ kubeinit_dns_public }}; 18 | 8.8.8.8; 19 | }; 20 | 21 | dnssec-validation auto; 22 | listen-on-v6 { none; }; 23 | 24 | /* Path to ISC DLV key */ 25 | /* Use the defaults */ 26 | /* bindkeys-file "/etc/named.root.key"; */ 27 | /* managed-keys-directory "/var/bind/dynamic"; */ 28 | /* pid-file "/run/named/named.pid"; */ 29 | /* session-keyfile "/run/named/session.key"; */ 30 | }; 31 | 32 | /* logging { */ 33 | /* channel default_debug { */ 34 | /* file "data/named.run"; */ 35 | /* severity dynamic; */ 36 | /* }; */ 37 | /* }; */ 38 | 39 | include "/etc/bind/bind.keys"; 40 | 41 | include "/etc/bind/kubeinit/named.conf.local"; 42 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/templates/named.conf.local.j2: -------------------------------------------------------------------------------- 1 | /* This file is rendered using a template from a KubeInit role */ 2 | /* This file will be overriden each time the playbook runs */ 3 | /* No not edit directly */ 4 | /* More information at: https://github.com/kubeinit/kubeinit */ 5 | 6 | acl internals { 7 | 127.0.0.0/8; 8 | {{ kubeinit_cluster_network }}; 9 | }; 10 | 11 | view "internal" { 12 | match-clients { internals; }; 13 | 14 | include "/etc/bind/zones.rfc1918"; 15 | include "/etc/bind/named.conf.default-zones"; 16 | 17 | /*zone "." IN {*/ 18 | /* type hint;*/ 19 | /* file "named.ca";*/ 20 | /*};*/ 21 | 22 | zone "{{ kubeinit_cluster_fqdn }}" { 23 | type master; 24 | file "/etc/bind/kubeinit/zones/internals/db.{{ kubeinit_cluster_fqdn }}"; # zone file path 25 | }; 26 | 27 | zone "{{ kubeinit_bind_service_address | ipaddr('revdns') | regex_replace('^[0-9]+\\.', '') }}" { 28 | type master; 29 | file "/etc/bind/kubeinit/zones/internals/db.{{ kubeinit_bind_service_address | ipsubnet(24) | ipaddr('network') }}"; # 192.168.1.0/24 subnet 30 | }; 31 | 32 | {% for cluster in groups['kubeinit_clusters'] | default([]) %} 33 | {% if not cluster == kubeinit_cluster_name %} 34 | {% set cluster_net_name = hostvars[cluster].network_name %} 35 | {% set cluster_nameserver_net = hostvars[cluster_net_name].network %} 36 | {% set cluster_nameserver_offset = hostvars[cluster_net_name].nameserver_offset %} 37 | {% set cluster_nameserver_addr = cluster_nameserver_net | ansible.utils.ipv4(cluster_nameserver_offset|int) | ansible.utils.ipv4('address') %} 38 | zone "{{ cluster }}.{{ hostvars[kubeinit_cluster_name].cluster_domain }}" IN { 39 | type forward; 40 | forward only; 41 | forwarders { 42 | {{ cluster_nameserver_addr }}; 43 | }; 44 | }; 45 | {% endif %} 46 | {% endfor %} 47 | }; 48 | 49 | acl bridge { 50 | 172.16.0.0/24; 51 | }; 52 | 53 | view "bridge" { 54 | match-clients { bridge; }; 55 | allow-query { any; }; 56 | 57 | zone "{{ kubeinit_cluster_fqdn }}" { 58 | type master; 59 | file "/etc/bind/kubeinit/zones/internals/db.{{ kubeinit_cluster_fqdn }}"; # zone file path 60 | }; 61 | 62 | }; 63 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_bind/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_bind_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_dnsmasq role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_dnsmasq.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_dnsmasq_" 21 | kubeinit_dnsmasq_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_dnsmasq_hide_sensitive_logs: true 23 | 24 | kubeinit_dnsmasq_directory: /var/kubeinit/dnsmasq 25 | 26 | kubeinit_dnsmasq_directories: 27 | - "{{ kubeinit_dnsmasq_directory }}" 28 | 29 | kubeinit_dnsmasq_config_file: "{{ kubeinit_dnsmasq_directory }}/dnsmasq.cfg" 30 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_dnsmasq/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_dnsmasq 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_dnsmasq 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_dnsmasq" 22 | tasks: 23 | - name: Message for "kubeinit_dnsmasq" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_dnsmasq" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/templates/dnsmasq.conf.j2: -------------------------------------------------------------------------------- 1 | interface={{ kubeinit_dnsmasq_interface }} 2 | no-hosts 3 | no-resolv 4 | bind-dynamic 5 | 6 | # Disable listening for DNS 7 | port=0 8 | 9 | log-dhcp 10 | log-facility=- 11 | 12 | dhcp-range={{ kubeinit_cluster_dhcp_start }},{{ kubeinit_cluster_dhcp_end }},1h 13 | 14 | dhcp-option=3,{{ kubeinit_cluster_gateway }} 15 | dhcp-option=6,{{ kubeinit_cluster_nameserver }} 16 | dhcp-option=15,{{ kubeinit_cluster_domain }} 17 | dhcp-option=26,1442 18 | dhcp-option=119,{{ kubeinit_cluster_domain }} 19 | 20 | {% for host in groups['all_service_nodes'] | list %} 21 | dhcp-host={{ hostvars[host].mac }},{{ host }}.{{ kubeinit_cluster_fqdn }},{{ hostvars[host].ansible_host }},1h 22 | {% endfor %} 23 | {% for host in groups['all_controller_nodes'] | list %} 24 | dhcp-host={{ hostvars[host].mac }},master{{ loop.index - 1 }}.{{ kubeinit_cluster_fqdn }},{{ hostvars[host].ansible_host }},1h 25 | {% endfor %} 26 | {% for host in groups['all_compute_nodes'] | default([]) | list %} 27 | dhcp-host={{ hostvars[host].mac }},worker{{ loop.index - 1 }}.{{ kubeinit_cluster_fqdn }},{{ hostvars[host].ansible_host }},1h 28 | {% endfor %} 29 | {% for host in groups['all_extra_nodes'] | default([]) | list %} 30 | dhcp-host={{ hostvars[host].mac }},{{ host }}.{{ kubeinit_cluster_fqdn }},{{ hostvars[host].ansible_host }},1h 31 | {% endfor %} 32 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_dnsmasq/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_dnsmasq_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_haproxy role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_haproxy.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_haproxy_" 21 | kubeinit_haproxy_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_haproxy_hide_sensitive_logs: true 23 | 24 | kubeinit_haproxy_directory: /var/kubeinit/haproxy 25 | kubeinit_haproxy_directory_conf: "{{ kubeinit_haproxy_directory }}/conf" 26 | kubeinit_haproxy_directory_lib: "{{ kubeinit_haproxy_directory }}/lib" 27 | 28 | kubeinit_haproxy_directories: 29 | - "{{ kubeinit_haproxy_directory_conf }}" 30 | - "{{ kubeinit_haproxy_directory_lib }}" 31 | 32 | kubeinit_haproxy_config_file: "{{ kubeinit_haproxy_directory_conf }}/haproxy.cfg" 33 | 34 | kubeinit_haproxy_global_maxconn: 20000 35 | kubeinit_haproxy_global_log: stdout format raw local0 info 36 | kubeinit_haproxy_defaults_timeout_client: 300s 37 | kubeinit_haproxy_defaults_timeout_server: 300s 38 | kubeinit_haproxy_defaults_maxconn: 20000 39 | kubeinit_haproxy_listen_stats_bind: 9000 40 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_haproxy/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_haproxy 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_haproxy 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_haproxy" 22 | tasks: 23 | - name: Message for "kubeinit_haproxy" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_haproxy" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_haproxy/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_haproxy_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_k8s role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_k8s.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_k8s_" 21 | kubeinit_k8s_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_k8s_hide_sensitive_logs: true 23 | 24 | kubeinit_k8s_kubernetes_version: "1.30" 25 | 26 | # This is the default container runtime that 27 | # will be deployed when the Vanila k8s cluster 28 | # is deployed. 29 | # So far, cri-o should be the default option, 30 | # but when testing confidential-containers 31 | # at the moment only containerd will work. 32 | kubeinit_k8s_container_runtime: "cri-o" 33 | # kubeinit_k8s_container_runtime: "containerd" 34 | 35 | kubeinit_k8s_flannel_version: "0.25.4" 36 | 37 | kubeinit_k8s_kustomize_version: "5.4.2" 38 | 39 | # This is the cluster CIDR taken from the net-conf.json in the kube-flannel-cfg configmap here: 40 | # https://github.com/flannel-io/flannel/releases/download/v{{ kubeinit_k8s_flannel_version }}/kube-flannel.yml 41 | kubeinit_k8s_pod_network_cidr: 10.244.0.0/16 42 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_k8s/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_k8s 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_k8s 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_k8s" 22 | tasks: 23 | - name: Message for "kubeinit_k8s" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_k8s" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/tasks/post_deployment_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | # 18 | # Deploy extra roles 19 | # 20 | - name: Deploy extra roles 21 | ansible.builtin.include_role: 22 | name: "kubeinit.kubeinit.{{ extra_role }}" 23 | public: yes 24 | loop: "{{ kubeinit_cluster_hostvars['extra_roles'] | default([]) }}" 25 | loop_control: 26 | loop_var: extra_role 27 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_k8s/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_k8s_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_libvirt role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_libvirt.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_libvirt/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_libvirt 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_libvirt 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_libvirt" 22 | tasks: 23 | - name: Message for "kubeinit_libvirt" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_libvirt" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/tasks/70_check_nodes_up.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | # 18 | # Verify that nodes are up before continuing 19 | # 20 | 21 | - name: "Make sure we can execute remote commands in {{ kubeinit_deployment_node_name }}" 22 | ansible.builtin.shell: | 23 | set -o pipefail 24 | ssh {{ hostvars[kubeinit_deployment_node_name].ansible_ssh_common_args }} \ 25 | {{ _param_guest_user | default('root') }}@{{ hostvars[kubeinit_deployment_node_name].ansible_host }} 'echo connected' || true 26 | args: 27 | executable: /bin/bash 28 | register: _result 29 | retries: 30 30 | delay: 10 31 | until: "'connected' in _result.stdout" 32 | changed_when: "_result.rc == 0" 33 | delegate_to: "{{ kubeinit_deployment_delegate }}" 34 | 35 | - name: "Wait for booting {{ kubeinit_deployment_node_name }}" 36 | ansible.builtin.wait_for_connection: 37 | connect_timeout: 20 38 | sleep: 5 39 | delay: 5 40 | timeout: 300 41 | vars: 42 | ansible_user: "{{ _param_guest_user | default('root') }}" 43 | delegate_to: "{{ kubeinit_deployment_node_name }}" 44 | when: _param_request_ping | default(true) | bool 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/00-installer-ubuntu-netconfig.yaml.j2: -------------------------------------------------------------------------------- 1 | # This file is rendered using a template from a KubeInit role 2 | # This file will be overridden each time the playbook runs 3 | # No not edit directly 4 | # More information at: https://github.com/kubeinit/kubeinit 5 | network: 6 | version: 2 7 | renderer: networkd 8 | 9 | ethernets: 10 | enp1s0: 11 | dhcp4: false 12 | dhcp6: false 13 | link-local: [ ] 14 | addresses: [{{ hostvars[kubeinit_deployment_node_name].ansible_host }}/{{ kubeinit_cluster_prefix }}] 15 | gateway4: {{ kubeinit_cluster_gateway }} 16 | match: 17 | macaddress: {{ hostvars[kubeinit_deployment_node_name].mac }} 18 | mtu: "1442" 19 | nameservers: 20 | #addresses: [{{ kubeinit_bind_service_address }}] 21 | addresses: [{{ kubeinit_dns_public }}] 22 | 23 | # enp1s0 24 | # enp2s0 25 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/101-cloudinit-hosts.tmpl.j2: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | # This file is rendered using a template from a KubeInit role 3 | # This file will be overridden each time the playbook runs 4 | # No not edit directly 5 | # More information at: https://github.com/kubeinit/kubeinit 6 | {# 7 | This file (/etc/cloud/templates/hosts.debian.tmpl) is only utilized 8 | if enabled in cloud-config. Specifically, in order to enable it 9 | you need to add the following to config: 10 | manage_etc_hosts: True 11 | -#} 12 | # Your system has configured 'manage_etc_hosts' as True. 13 | # As a result, if you wish for changes to this file to persist 14 | # then you will need to either 15 | # a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl 16 | # b.) change or remove the value of 'manage_etc_hosts' in 17 | # /etc/cloud/cloud.cfg or cloud-config from user-data 18 | # 19 | {# The value '{{hostname}}' will be replaced with the local-hostname -#} 20 | 127.0.1.1 {% raw %}{{fqdn}} {{hostname}}{% endraw %} 21 | 22 | 127.0.0.1 localhost 23 | 24 | # The following lines are desirable for IPv6 capable hosts 25 | ::1 localhost ip6-localhost ip6-loopback 26 | ff02::1 ip6-allnodes 27 | ff02::2 ip6-allrouters 28 | 29 | {% for node in groups['all_nodes'] %} 30 | {{ hostvars[node].ansible_host }} {{ node }}.{{ kubeinit_cluster_fqdn }} {{ node }} 31 | {% endfor %} 32 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/90-cloudinit-dpkg.cfg.j2: -------------------------------------------------------------------------------- 1 | # This file is rendered using a template from a KubeInit role 2 | # This file will be overridden each time the playbook runs 3 | # No not edit directly 4 | # More information at: https://github.com/kubeinit/kubeinit 5 | 6 | datasource_list: [ ConfigDrive, None ] 7 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/authorized_keys.j2: -------------------------------------------------------------------------------- 1 | {% for authorized_key in kubeinit_cluster_hostvars.authorized_keys %} 2 | {{ authorized_key }} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/cluster-net.xml.j2: -------------------------------------------------------------------------------- 1 | 2 | {{ kubeinit_cluster_network_name }} 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/debian-network-config-enp1s0.j2: -------------------------------------------------------------------------------- 1 | network: 2 | version: 2 3 | ethernets: 4 | enp1s0: 5 | addresses: 6 | - "{{ hostvars[kubeinit_deployment_node_name].ansible_host }}/{{ kubeinit_cluster_prefix }}" 7 | mtu: 1442 8 | nameservers: 9 | addresses: 10 | - "{{ kubeinit_cluster_nameserver }}" 11 | routes: 12 | - to: "default" 13 | via: "{{ kubeinit_cluster_gateway }}" 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/templates/ifcfg-eth0.j2: -------------------------------------------------------------------------------- 1 | # This file is rendered using a template from a KubeInit role 2 | # This file will be overridden each time the playbook runs 3 | # No not edit directly 4 | # More information at: https://github.com/kubeinit/kubeinit 5 | 6 | # 7 | # Generated when provision the VM details from ifcfg-eth0.j2 8 | # 9 | BOOTPROTO=static 10 | NAME=eth0 11 | DEVICE=eth0 12 | IPV4_FAILURE_FATAL=no 13 | #DNS1={{ kubeinit_bind_service_address }} 14 | DNS1={{ kubeinit_dns_public }} 15 | DOMAIN={{ hostvars[kubeinit_cluster_name].cluster_domain }} 16 | GATEWAY={{ kubeinit_cluster_gateway }} 17 | DEFROUTE=yes 18 | IPADDR={{ hostvars[kubeinit_deployment_node_name].ansible_host }} 19 | NETMASK={{ kubeinit_cluster_netmask }} 20 | MACADDR={{ hostvars[kubeinit_deployment_node_name].mac }} 21 | ONBOOT=yes 22 | TYPE=Ethernet 23 | USERCTL=no 24 | LINKDELAY=60 25 | # Per OVN requirements 26 | MTU=1442 27 | 28 | # We need to add LINKDELAY 29 | # https://access.redhat.com/solutions/2523931 30 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_libvirt/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_libvirt_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_openshift role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_openshift.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_openshift_" 21 | kubeinit_openshift_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_openshift_hide_sensitive_logs: true 23 | 24 | kubeinit_openshift_pod_cidr: 10.100.0.0/14 25 | kubeinit_openshift_service_cidr: 172.30.0.0/16 26 | 27 | kubeinit_openshift_network_type: "OVNKubernetes" 28 | 29 | kubeinit_openshift_registry_pullsecret: "{{ '{\"auths\": {}}' | from_json }}" 30 | kubeinit_openshift_registry_pullsecret_empty: "{{ '{\"auths\": {}}' | from_json }}" 31 | 32 | kubeinit_openshift_registry: 33 | okd: 34 | organization: openshift 35 | repository: okd 36 | ocp: 37 | organization: openshift-release-dev 38 | repository: ocp-release 39 | 40 | kubeinit_openshift_registry_site: quay.io 41 | kubeinit_openshift_registry_organization: "{{ kubeinit_openshift_registry[kubeinit_cluster_distro].organization }}" 42 | kubeinit_openshift_registry_repository: "{{ kubeinit_openshift_registry[kubeinit_cluster_distro].repository }}" 43 | 44 | kubeinit_openshift_release: 45 | okd: 46 | tag: 4.15.0-0.okd-2024-03-10-010116 47 | ocp: 48 | tag: 4.16.2 49 | 50 | kubeinit_openshift_release_tag: "{{ kubeinit_openshift_release[kubeinit_cluster_distro].tag }}" 51 | 52 | kubeinit_openshift_download: 53 | okd: 54 | baseurl: "https://github.com/openshift/okd/releases/download/{{ kubeinit_openshift_release_tag }}" 55 | ocp: 56 | baseurl: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ kubeinit_openshift_release_tag }}" 57 | 58 | kubeinit_openshift_download_baseurl: "{{ kubeinit_openshift_download[kubeinit_cluster_distro].baseurl }}" 59 | 60 | kubeinit_openshift_download_url: 61 | client: "{{ kubeinit_openshift_download_baseurl }}/openshift-client-linux-{{ kubeinit_openshift_release_tag }}.tar.gz" 62 | installer: "{{ kubeinit_openshift_download_baseurl }}/openshift-install-linux-{{ kubeinit_openshift_release_tag }}.tar.gz" 63 | release_txt: "{{ kubeinit_openshift_download_baseurl }}/release.txt" 64 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_openshift/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_openshift 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_openshift 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_openshift" 22 | tasks: 23 | - name: Message for "kubeinit_openshift" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_openshift" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/tasks/post_deployment_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | # 18 | # Deploy extra roles 19 | # 20 | - name: Deploy extra roles 21 | ansible.builtin.include_role: 22 | name: "kubeinit.kubeinit.{{ extra_role }}" 23 | public: yes 24 | loop: "{{ kubeinit_cluster_hostvars['extra_roles'] | default([]) }}" 25 | loop_control: 26 | loop_var: extra_role 27 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/templates/install-config.yaml.j2: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | baseDomain: {{ hostvars[kubeinit_cluster_name].cluster_domain }} 3 | compute: 4 | - hyperthreading: Enabled 5 | name: worker 6 | replicas: 0 7 | controlPlane: 8 | hyperthreading: Enabled 9 | name: master 10 | replicas: {{ kubeinit_controller_count }} 11 | metadata: 12 | name: {{ kubeinit_cluster_name }} 13 | networking: 14 | clusterNetwork: 15 | - cidr: {{ kubeinit_openshift_pod_cidr }} 16 | hostPrefix: 23 17 | networkType: {{ kubeinit_openshift_network_type }} 18 | serviceNetwork: 19 | - {{ kubeinit_openshift_service_cidr }} 20 | platform: 21 | none: {} 22 | fips: false 23 | {% if 'registry' in kubeinit_cluster_hostvars.services %} 24 | pullSecret: ' {{ kubeinit_registry_pullsecret | to_json }}' 25 | {% else %} 26 | pullSecret: ' {{ kubeinit_openshift_registry_pullsecret | to_json }}' 27 | {% endif %} 28 | sshKey: | 29 | {% for authorized_key in kubeinit_cluster_hostvars.authorized_keys %} 30 | {{ authorized_key }} 31 | {% endfor %} 32 | {% if 'registry' in kubeinit_cluster_hostvars.services %} 33 | additionalTrustBundle: | 34 | {{ kubeinit_cluster_hostvars.domain_cert | regex_replace('\n', '\n ') }} 35 | imageContentSources: 36 | - mirrors: 37 | - {{ kubeinit_registry_uri }}/okd 38 | source: quay.io/openshift/okd 39 | - mirrors: 40 | - {{ kubeinit_registry_uri }}/okd 41 | source: quay.io/openshift/okd-content 42 | {% endif %} 43 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_openshift/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_openshift_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_prepare role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_prepare.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_prepare_" 21 | kubeinit_prepare_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_prepare_hide_sensitive_logs: true 23 | 24 | kubeinit_prepare_podman_dependencies: 25 | - podman 26 | - buildah 27 | - skopeo 28 | - netavark 29 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_prepare/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_prepare 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_prepare 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_prepare" 22 | tasks: 23 | - name: Message for "kubeinit_prepare" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_prepare" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/tasks/create_host_ssh_config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | ### DOCUMENTATION 18 | # 19 | # title: Create an ssh config file for a list of hosts 20 | # 21 | # description: |- 22 | # This task has two params for the template task below 23 | # - config_path optional default: '~/.ssh/config' 24 | # - file_mode optional default: '0644' 25 | # 26 | # and two passthrough params for the template itself 27 | # - ssh_hosts required list of hosts 28 | # - ssh_keytype optional default: 'rsa' 29 | # - keypair_path optional default: '~/.ssh/id_' + ssh_keytype 30 | # - include_paths optional default: empty list 31 | # 32 | # The hosts are used as hostvars keys meeting the following expectations: 33 | # 34 | # hostvars[host].ansible_host must be defined. 35 | # 36 | # A stanza will be added to the ssh config pairing each host with the 37 | # corresponding ansible_host 38 | # 39 | # hostvars[host].ssh_connection_address may be defined 40 | # hostvars[host].ssh_hostname may be defined 41 | # 42 | # A stanza will be added to the ssh config pairing each ansible_host with either of 43 | # these, in the order listed. If neither is defined then the pairing will be omitted. 44 | # 45 | # examples: |- 46 | # - include_role: 47 | # name: kubeinit.kubeinit.kubeinit_prepare 48 | # tasks_from: create_host_ssh_config 49 | # vars: 50 | # ssh_hosts: "{{ groups['kubeinit_hypervisors'] }}" 51 | # keypair_path: "{{ kubeinit_cluster_keypair_path }}" 52 | # config_path: "{{ kubeinit_cluster_ssh_config }}" 53 | # file_mode: '0644' 54 | 55 | - name: Create ssh config file from template 56 | ansible.builtin.template: 57 | src: ssh-config.j2 58 | dest: "{{ _param_dest_path | default('~/.ssh/config') }}" 59 | mode: "{{ _param_file_mode | default('0644') }}" 60 | 61 | - name: Print the contents of the result 62 | ansible.builtin.command: cat {{ _param_dest_path | default('~/.ssh/config') }} 63 | register: _result 64 | changed_when: "_result.rc == 0" 65 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/tasks/deploy_cluster.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | - name: Prepare services and stop the deployment if required 18 | block: 19 | - name: Prepare services if needed 20 | ansible.builtin.include_role: 21 | name: kubeinit.kubeinit.kubeinit_services 22 | tasks_from: prepare_services.yml 23 | public: true 24 | vars: 25 | services_prepared: "{{ 'kubeinit_facts' in groups }}" 26 | when: not services_prepared 27 | 28 | - name: Stop the deployment if required 29 | block: 30 | - name: "Stop before 'task-deploy-cluster' when requested" 31 | ansible.builtin.add_host: 32 | name: "kubeinit-facts" 33 | playbook_terminated: true 34 | - name: End play 35 | ansible.builtin.meta: end_play 36 | when: kubeinit_stop_before_task is defined and kubeinit_stop_before_task == 'task-deploy-cluster' 37 | tags: omit_from_grapher 38 | 39 | - name: Delegate to the distro role to deploy the cluster 40 | ansible.builtin.include_role: 41 | name: "kubeinit.kubeinit.{{ kubeinit_cluster_distro_role }}" 42 | public: true 43 | 44 | - name: Update hosts and stop the deployment if required 45 | block: 46 | - name: Add task-deploy-cluster to tasks_completed 47 | ansible.builtin.add_host: 48 | name: "kubeinit-facts" 49 | tasks_completed: "{{ kubeinit_facts_hostvars.tasks_completed | union(['task-deploy-cluster']) }}" 50 | 51 | - name: Update kubeinit_facts_hostvars 52 | ansible.builtin.set_fact: 53 | kubeinit_facts_hostvars: "{{ hostvars['kubeinit-facts'] }}" 54 | 55 | - name: Stop the deployment if required 56 | block: 57 | - name: Stop after 'task-deploy-cluster' when requested 58 | ansible.builtin.add_host: 59 | name: "kubeinit-facts" 60 | playbook_terminated: true 61 | - name: End play 62 | ansible.builtin.meta: end_play 63 | when: kubeinit_stop_after_task is defined and kubeinit_stop_after_task in kubeinit_facts_hostvars.tasks_completed 64 | tags: omit_from_grapher 65 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/tasks/post_deployment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | - name: Prepare services and stop the deployment if required 18 | block: 19 | - name: Prepare services if needed 20 | ansible.builtin.include_role: 21 | name: kubeinit.kubeinit.kubeinit_services 22 | tasks_from: prepare_services.yml 23 | public: true 24 | vars: 25 | services_prepared: "{{ 'kubeinit_facts' in groups }}" 26 | when: not services_prepared 27 | 28 | - name: Stop the deployment if required 29 | block: 30 | - name: "Stop before 'task-post-deployment' when requested" 31 | ansible.builtin.add_host: 32 | name: "kubeinit-facts" 33 | playbook_terminated: true 34 | - name: End play 35 | ansible.builtin.meta: end_play 36 | when: kubeinit_stop_before_task is defined and kubeinit_stop_before_task == 'task-post-deployment' 37 | tags: omit_from_grapher 38 | 39 | - name: Delegate to distro role to run post-deployment tasks 40 | ansible.builtin.include_role: 41 | name: "kubeinit.kubeinit.{{ kubeinit_cluster_distro_role }}" 42 | tasks_from: post_deployment_tasks.yml 43 | public: true 44 | 45 | - name: Gather hosts facts and stop the deployment if required 46 | block: 47 | - name: Add task-post-deployment to tasks_completed 48 | ansible.builtin.add_host: 49 | name: "kubeinit-facts" 50 | tasks_completed: "{{ kubeinit_facts_hostvars.tasks_completed | union(['task-post-deployment']) }}" 51 | 52 | - name: Update kubeinit_facts_hostvars 53 | ansible.builtin.set_fact: 54 | kubeinit_facts_hostvars: "{{ hostvars['kubeinit-facts'] }}" 55 | 56 | - name: Stop the deployment if required 57 | block: 58 | - name: Stop after 'task-post-deployment' when requested 59 | ansible.builtin.add_host: 60 | name: "kubeinit-facts" 61 | playbook_terminated: true 62 | - name: End play 63 | ansible.builtin.meta: end_play 64 | when: kubeinit_stop_after_task is defined and kubeinit_stop_after_task in kubeinit_facts_hostvars.tasks_completed 65 | tags: omit_from_grapher 66 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/tasks/prepare_cluster.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | - name: Prepare services and stop the deployment if required 18 | block: 19 | - name: Prepare services if needed 20 | ansible.builtin.include_role: 21 | name: kubeinit.kubeinit.kubeinit_services 22 | tasks_from: prepare_services.yml 23 | public: true 24 | vars: 25 | services_prepared: "{{ 'kubeinit_facts' in groups }}" 26 | when: not services_prepared 27 | 28 | - name: Stop the deployment if required 29 | block: 30 | - name: "Stop before 'task-prepare-cluster' when requested" 31 | ansible.builtin.add_host: 32 | name: "kubeinit-facts" 33 | playbook_terminated: true 34 | - name: End play 35 | ansible.builtin.meta: end_play 36 | when: kubeinit_stop_before_task is defined and kubeinit_stop_before_task == 'task-prepare-cluster' 37 | tags: omit_from_grapher 38 | 39 | - name: Delegate to the distro role to prepare the cluster 40 | ansible.builtin.include_role: 41 | name: "kubeinit.kubeinit.{{ kubeinit_cluster_distro_role }}" 42 | tasks_from: prepare_cluster.yml 43 | public: true 44 | 45 | - name: Gather hosts facts and stop the deployment if required 46 | block: 47 | - name: Add task-prepare-cluster to tasks_completed 48 | ansible.builtin.add_host: 49 | name: "kubeinit-facts" 50 | tasks_completed: "{{ kubeinit_facts_hostvars.tasks_completed | union(['task-prepare-cluster']) }}" 51 | 52 | - name: Update kubeinit_facts_hostvars 53 | ansible.builtin.set_fact: 54 | kubeinit_facts_hostvars: "{{ hostvars['kubeinit-facts'] }}" 55 | 56 | - name: Stop the deployment if required 57 | block: 58 | - name: Stop after 'task-prepare-cluster' when requested 59 | ansible.builtin.add_host: 60 | name: "kubeinit-facts" 61 | playbook_terminated: true 62 | - name: End play 63 | ansible.builtin.meta: end_play 64 | when: kubeinit_stop_after_task is defined and kubeinit_stop_after_task in kubeinit_facts_hostvars.tasks_completed 65 | tags: omit_from_grapher 66 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/tasks/prepare_hypervisor.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | # 18 | # Prepare the hypervisor 19 | # 20 | 21 | - name: Delegate to kubeinit_deployment_node_name (inventory_hostname) 22 | block: 23 | 24 | - name: Generate an OpenSSH keypair on kubeinit_deployment_node_name 25 | community.crypto.openssh_keypair: 26 | path: "~/.ssh/{{ hostvars['kubeinit-facts'].cluster_name }}_id_{{ hostvars['kubeinit-facts'].ssh_keytype }}" 27 | type: "{{ hostvars['kubeinit-facts'].ssh_keytype }}" 28 | comment: "{{ hostvars['kubeinit-facts'].cluster_name + ' ' + kubeinit_deployment_node_name }}" 29 | regenerate: 'never' 30 | register: _result_keypair 31 | 32 | - name: Create authorized_key from keypair 33 | ansible.builtin.set_fact: 34 | authorized_key: "{{ _result_keypair.public_key + ' ' + _result_keypair.comment }}" 35 | delegate_facts: true 36 | 37 | - name: Provision the libvirt services on the hypervisor 38 | ansible.builtin.include_role: 39 | name: kubeinit.kubeinit.kubeinit_libvirt 40 | public: true 41 | 42 | vars: 43 | kubeinit_deployment_node_name: "{{ inventory_hostname }}" 44 | delegate_to: "{{ kubeinit_deployment_node_name }}" 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/tasks/prepare_hypervisors.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | - name: Gather hosts facts and stop the deployment if required 18 | block: 19 | - name: Gather kubeinit facts if needed 20 | ansible.builtin.include_tasks: gather_kubeinit_facts.yml 21 | vars: 22 | facts_prepared: "{{ 'kubeinit_facts' in groups }}" 23 | when: not facts_prepared 24 | 25 | - name: Stop the deployment if required 26 | block: 27 | - name: "Stop before 'task-prepare-hypervisors' when requested" 28 | ansible.builtin.add_host: 29 | name: "kubeinit-facts" 30 | playbook_terminated: true 31 | - name: End play 32 | ansible.builtin.meta: end_play 33 | when: kubeinit_stop_before_task is defined and kubeinit_stop_before_task == 'task-prepare-hypervisors' 34 | tags: omit_from_grapher 35 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/templates/ssh-config.j2: -------------------------------------------------------------------------------- 1 | {% for include_path in _param_include_paths | default([]) %} 2 | Include {{ include_path }} 3 | 4 | {% endfor %} 5 | {% for host in _param_hosts %} 6 | Host {{ host }} 7 | Hostname {{ hostvars[host].ansible_host }} 8 | IdentityFile {{ _param_keypair_path | default('~/.ssh/id_' + (_param_ssh_keytype | default('rsa'))) }} 9 | UserKnownHostsFile /dev/null 10 | StrictHostKeyChecking accept-new 11 | 12 | {% if hostvars[host].ansible_host | ansible.utils.ipv4 %} 13 | Host {{ hostvars[host].ansible_host }} 14 | IdentityFile {{ _param_keypair_path | default('~/.ssh/id_' + (_param_ssh_keytype | default('rsa'))) }} 15 | UserKnownHostsFile /dev/null 16 | StrictHostKeyChecking accept-new 17 | 18 | {% elif hostvars[host].ssh_connection_address is defined or hostvars[host].ssh_hostname is defined %} 19 | Host {{ hostvars[host].ansible_host }} 20 | Hostname {{ hostvars[host].ssh_connection_address if (hostvars[host].ssh_connection_address is defined) else hostvars[host].ssh_hostname }} 21 | IdentityFile {{ _param_keypair_path | default('~/.ssh/id_' + (_param_ssh_keytype | default('rsa'))) }} 22 | UserKnownHostsFile /dev/null 23 | StrictHostKeyChecking accept-new 24 | 25 | {% endif %} 26 | {% endfor %} 27 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_prepare/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_prepare_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_registry role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_registry.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_registry_" 21 | kubeinit_registry_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_registry_hide_sensitive_logs: true 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_registry/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_registry 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_registry 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_registry" 22 | tasks: 23 | - name: Message for "kubeinit_registry" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_registry" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_registry/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_registry_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_services role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_services.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_services_" 21 | kubeinit_services_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_services_hide_sensitive_logs: true 23 | 24 | kubeinit_services_container_image: "quay.io/centos/centos:stream9" 25 | 26 | kubeinit_registry_directory: /var/kubeinit/registry 27 | kubeinit_registry_directory_auth: "{{ kubeinit_registry_directory }}/auth" 28 | kubeinit_registry_directory_cert: "{{ kubeinit_registry_directory }}/certs" 29 | 30 | kubeinit_registry_domain_cert: "{{ kubeinit_registry_directory_cert }}/domain.crt" 31 | 32 | kubeinit_registry_directories: 33 | - "{{ kubeinit_registry_directory_auth }}" 34 | - "{{ kubeinit_registry_directory_cert }}" 35 | 36 | kubeinit_registry_pullsecret: "{{ '{\"auths\": {}}' | from_json }}" 37 | 38 | kubeinit_registry_auth_file: registry-auths.json 39 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_services/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_services 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_services 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_services" 22 | tasks: 23 | - name: Message for "kubeinit_services" 24 | ansible.builtin.debug: 25 | msg: Finishing molecule for "kubeinit_services" 26 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/tasks/prepare_services.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | - name: Prepare environment if needed 18 | ansible.builtin.include_role: 19 | name: kubeinit.kubeinit.kubeinit_prepare 20 | public: true 21 | vars: 22 | environment_prepared: "{{ kubeinit_cluster_name is defined }}" 23 | when: not environment_prepared 24 | 25 | - name: Read in the contents of domain.crt 26 | ansible.builtin.slurp: 27 | src: ~/domain.crt 28 | register: _result_domain_cert_b64 29 | delegate_to: "{{ kubeinit_provision_service_node }}" 30 | when: kubeinit_cluster_hostvars.domain_cert is not defined 31 | 32 | - name: Add contents of domain.crt cluster vars 33 | ansible.builtin.add_host: 34 | name: "{{ kubeinit_cluster_name }}" 35 | domain_cert: "{{ _result_domain_cert_b64.content | string | b64decode }}" 36 | when: kubeinit_cluster_hostvars.domain_cert is not defined 37 | 38 | - name: Read in the contents of registry-auths.json 39 | ansible.builtin.slurp: 40 | src: ~/registry-auths.json 41 | register: _result_registry_auths_b64 42 | delegate_to: "{{ kubeinit_provision_service_node }}" 43 | when: kubeinit_cluster_hostvars.registry_disconnected_auth is not defined 44 | 45 | - name: Add contents of regustry-auths.json to cluster vars 46 | ansible.builtin.add_host: 47 | name: "{{ kubeinit_cluster_name }}" 48 | registry_disconnected_auth: "{{ _result_registry_auths_b64.content | string | b64decode }}" 49 | when: kubeinit_cluster_hostvars.registry_disconnected_auth is not defined 50 | 51 | - name: Update kubeinit_cluster_hostvars 52 | ansible.builtin.set_fact: 53 | kubeinit_cluster_hostvars: "{{ hostvars[kubeinit_cluster_name] }}" 54 | when: > 55 | kubeinit_cluster_hostvars.domain_cert is not defined or 56 | kubeinit_cluster_hostvars.registry_disconnected_auth is not defined 57 | 58 | - name: Gather network and host facts for guest 59 | ansible.builtin.include_role: 60 | name: kubeinit.kubeinit.kubeinit_libvirt 61 | tasks_from: gather_host_facts.yml 62 | public: yes 63 | vars: 64 | _param_gather_host: "{{ kubeinit_provision_service_node }}" 65 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/tasks/start_services_containers.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Delegate to service node VM 19 | block: 20 | 21 | # 22 | # Configure bind 23 | # 24 | - name: Configure Bind 25 | ansible.builtin.include_role: 26 | name: kubeinit.kubeinit.kubeinit_bind 27 | public: true 28 | when: "'bind' in hostvars[kubeinit_deployment_node_name].services" 29 | 30 | # 31 | # Configure Dnsmasq 32 | # 33 | - name: Configure Dnsmasq 34 | ansible.builtin.include_role: 35 | name: kubeinit.kubeinit.kubeinit_dnsmasq 36 | public: true 37 | when: "'dnsmasq' in hostvars[kubeinit_deployment_node_name].services" 38 | 39 | # 40 | # Configure HAproxy 41 | # 42 | - name: Configure HAProxy 43 | ansible.builtin.include_role: 44 | name: kubeinit.kubeinit.kubeinit_haproxy 45 | public: true 46 | when: "'haproxy' in hostvars[kubeinit_deployment_node_name].services" 47 | 48 | # 49 | # Configure httpd 50 | # 51 | - name: Configure Apache 52 | ansible.builtin.include_role: 53 | name: kubeinit.kubeinit.kubeinit_apache 54 | public: true 55 | when: "'apache' in hostvars[kubeinit_deployment_node_name].services" 56 | 57 | # 58 | # Configure container registry 59 | # 60 | - name: Configure a local container image registry 61 | ansible.builtin.include_role: 62 | name: kubeinit.kubeinit.kubeinit_registry 63 | public: true 64 | when: "'registry' in hostvars[kubeinit_deployment_node_name].services" 65 | 66 | delegate_to: "{{ kubeinit_deployment_delegate }}" 67 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_services/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_services_" 23 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/README.md: -------------------------------------------------------------------------------- 1 | Please, refer to the kubeinit_validations role 2 | [official docs](https://kubeinit.github.io/kubeinit/roles/role-kubeinit_validations.html) 3 | for further information. 4 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # All variables intended for modification should be placed in this file. 19 | 20 | # All variables within this role should have a prefix of "kubeinit_validations_" 21 | kubeinit_validations_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" 22 | kubeinit_validations_hide_sensitive_logs: true 23 | 24 | # The validation will fail if the libvirt path is not found 25 | kubeinit_validations_libvirt_path: "/var/lib/libvirt" 26 | # If libvirt is not installed we will compare with the 27 | # space available in the parent folder. 28 | kubeinit_validations_libvirt_path_fallback: "/var/lib" 29 | kubeinit_validations_local_required_packages: 30 | - python3-netaddr 31 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kubeinit/kubeinit/da6fec314d5594b6bd97ef2e4e71f9098a85e63c/kubeinit/roles/kubeinit_validations/files/.gitkeep -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | galaxy_info: 19 | author: KubeInit 20 | role_name: kubeinit_validations 21 | namespace: kubeinit 22 | description: KubeInit Role -- kubeinit_validations 23 | company: Red Hat 24 | license: Apache-2.0 25 | min_ansible_version: 2.9 26 | # 27 | # Provide a list of supported platforms, and for each platform a list of versions. 28 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 29 | # To view available platforms and versions (or releases), visit: 30 | # https://galaxy.ansible.com/api/v1/platforms/ 31 | # 32 | platforms: 33 | - name: CentOS 34 | versions: 35 | - 7 36 | - 8 37 | 38 | galaxy_tags: 39 | - kubeinit 40 | 41 | 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | dependencies: [] 45 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | - name: Converge 19 | hosts: all 20 | # roles: 21 | # - role: "kubeinit_validations" 22 | tasks: 23 | - name: Message 24 | vars: 25 | msg: | 26 | Finishing the execution of 27 | the test 28 | ansible.builtin.debug: 29 | msg: "{{ msg.split('\n') }}" 30 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: instance 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | provisioner: 11 | name: ansible 12 | verifier: 13 | name: ansible 14 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | tasks: 7 | - name: Example assertion 8 | ansible.builtin.assert: 9 | that: true 10 | -------------------------------------------------------------------------------- /kubeinit/roles/kubeinit_validations/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Copyright kubeinit contributors 3 | # All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 6 | # not use this file except in compliance with the License. You may obtain 7 | # a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations 15 | # under the License. 16 | 17 | 18 | # While options found within the vars/ path can be overridden using extra 19 | # vars, items within this path are considered part of the role and not 20 | # intended to be modified. 21 | 22 | # All variables within this role should have a prefix of "kubeinit_validations_" 23 | -------------------------------------------------------------------------------- /kubeinit/tests/sanity/ignore-2.9.txt: -------------------------------------------------------------------------------- 1 | plugins/modules/package.py validate-modules:missing-gplv3-license 2 | -------------------------------------------------------------------------------- /kubeinit/tests/unit/test_package.py: -------------------------------------------------------------------------------- 1 | """test_package unit test.""" 2 | 3 | from __future__ import (absolute_import, division, print_function) 4 | __metaclass__ = type 5 | 6 | import unittest 7 | 8 | from ansible_collections.kubeinit.kubeinit.plugins.module_utils \ 9 | import const 10 | 11 | 12 | class TestStringMethods(unittest.TestCase): 13 | """Run the TestStringMethods method. 14 | 15 | This method check if test_isupper pass 16 | """ 17 | 18 | def test_upper(self): 19 | """Run the test_upper method.""" 20 | self.assertEqual(const.KUBEINIT_VERSION.upper(), const.KUBEINIT_VERSION) 21 | 22 | def test_isupper(self): 23 | """Run the test_isupper method.""" 24 | self.assertTrue('FOO'.isupper()) 25 | self.assertFalse('Foo'.isupper()) 26 | 27 | def test_split(self): 28 | """Run the test_split method.""" 29 | s = 'hello world' 30 | self.assertEqual(s.split(), ['hello', 'world']) 31 | # check that s.split fails when the separator is not a string 32 | with self.assertRaises(TypeError): 33 | s.split(2) 34 | 35 | 36 | if __name__ == '__main__': 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /molecule/hosts.ini: -------------------------------------------------------------------------------- 1 | localhost ansible_connection=local ansible_host=localhost 2 | -------------------------------------------------------------------------------- /molecule/molecule-requirements.txt: -------------------------------------------------------------------------------- 1 | # this is required for the molecule jobs 2 | ansible 3 | ansi2html 4 | docker 5 | pytest 6 | pytest-cov 7 | pytest-html 8 | pytest-xdist 9 | pytest-molecule 10 | mock 11 | molecule 12 | molecule-docker 13 | netaddr 14 | -------------------------------------------------------------------------------- /molecule/molecule-requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - community.docker 4 | -------------------------------------------------------------------------------- /molecule/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 Red Hat, Inc. 3 | # Copyright 2020 KubeInit 4 | 5 | # All Rights Reserved. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | # not use this file except in compliance with the License. You may obtain 9 | # a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | # License for the specific language governing permissions and limitations 17 | # under the License. 18 | 19 | set -o pipefail 20 | set -xeuo 21 | 22 | if [ ! -f tox.ini ]; then 23 | echo "EXECUTE THIS SCRIPT FROM THE REPOSITORY ROOT DIRECTORY" 24 | echo "EXECUTE THIS SCRIPT FROM THE REPOSITORY ROOT DIRECTORY" 25 | echo "EXECUTE THIS SCRIPT FROM THE REPOSITORY ROOT DIRECTORY" 26 | echo "EXECUTE THIS SCRIPT FROM THE REPOSITORY ROOT DIRECTORY" 27 | echo "like: ./molecule/run.sh" 28 | exit 1 29 | fi 30 | 31 | # Install Molecule Python requirements 32 | python3 -m pip install -r ./molecule/molecule-requirements.txt 33 | 34 | # Install Kubeinit and Molecule Ansible collections requirements 35 | ansible-galaxy collection install --force -r ./kubeinit/requirements.yml 36 | ansible-galaxy collection install --force -r ./molecule/molecule-requirements.yml 37 | 38 | # Run molecule 39 | cd ./kubeinit/roles/ 40 | python3 -m pytest \ 41 | --trace \ 42 | --color=no \ 43 | --html=/tmp/reports.html \ 44 | --self-contained-html 45 | -------------------------------------------------------------------------------- /role-addition.yml: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ansible-playbook 2 | --- 3 | # Copyright 2019 Red Hat, Inc. 4 | # Copyright 2020 KubeInit 5 | # 6 | # All Rights Reserved. 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | # not use this file except in compliance with the License. You may obtain 10 | # a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 17 | # License for the specific language governing permissions and limitations 18 | # under the License. 19 | 20 | - name: Create a new role for KubeInit 21 | hosts: localhost 22 | connection: local 23 | gather_facts: false 24 | tasks: 25 | - name: Check for role name 26 | fail: 27 | msg: >- 28 | The required variable `role_name` is undefined. Check your settings. 29 | when: 30 | - role_name is undefined 31 | 32 | - name: Check for role name syntax 33 | fail: 34 | msg: >- 35 | The role_name must be ^kubeinit-[a-z0-9]+$ 36 | when: not role_name|regex_search('^kubeinit-[a-z0-9]+$') 37 | 38 | - name: Normalize the role name 39 | set_fact: 40 | _role_name: "{{ role_name | replace('-', '_' ) }}" 41 | 42 | - name: Create role 43 | command: >- 44 | ansible-galaxy init 45 | --role-skeleton=_skeleton_role_ 46 | --init-path=kubeinit/roles {{ _role_name }} 47 | args: 48 | creates: "kubeinit/roles/{{ _role_name }}" 49 | 50 | - name: Create role documentation 51 | copy: 52 | content: | 53 | {% set opening = 'Role - ' ~ _role_name %} 54 | {{ '=' * (opening | length) }} 55 | {{ opening }} 56 | {{ '=' * (opening | length) }} 57 | 58 | .. ansibleautoplugin:: 59 | :role: kubeinit/roles/{{ _role_name }} 60 | dest: "docs/src/roles/role-{{ _role_name }}.rst" 61 | mode: '0755' 62 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | ansible==8.0.0 2 | tox 3 | ansible-lint==6.0.0 4 | cryptography 5 | jinja2 6 | mock 7 | markdown 8 | netaddr 9 | pytest==7.2.1 10 | pytest-ansible 11 | pytest-mock 12 | pytest-xdist 13 | pytest-html 14 | pyyaml 15 | flake8 16 | flake8-bugbear 17 | flake8-colors 18 | flake8-docstrings 19 | flake8-import-order 20 | pep8-naming 21 | nodeenv 22 | pygithub 23 | requests 24 | yamllint 25 | bashate 26 | pycodestyle 27 | shyaml 28 | pylint 29 | voluptuous 30 | google-cloud-storage 31 | b2sdk 32 | yq 33 | --------------------------------------------------------------------------------