Code Monkey home page Code Monkey logo

casl-ansible's Introduction

CASL Ansible

CASL Ansible provides a common experience for provisioning infrastructure for OpenShift across a number of infrastructure providers using Ansible.

This includes automation of OpenShift Cluster provisioning as well as other automation tasks post-provisioning.

What Can I Do with CASL Tools?
  • Automated provisioning of an OpenShift cluster with existing automation infrastructure.

  • Automated provisioning of an OpenShift cluster on a non-automated static (BYO) infrastructure.

Provisioning An OpenShift Cluster with Existing Automation Infrastructure

The CASL Ansible tools provide everything needed to automatically provision an OpenShift cluster from scratch.

Prerequisites

  • A basic understanding of the CASL Architecture Overview, which outlines the end to end approach for automated provisioning OpenShift clusters.

  • Access to one of the following compatible infrastructures for deploying an OpenShift cluster:

    • An OpenStack environment.

    • An AWS environment.

    • A GCP environment.

Provisioning An OpenShift Cluster with BYO Infrastructure

The CASL Ansible tools also enable you to provision an OpenShift cluster on static infrastructure where provisioning is not fully automated. More details are available in the Bring Your Own Infrastructure guide.

Additional Resources

External Dependencies

For some tasks, CASL Ansible has dependencies on external repositories:

Infra Ansible

A repository of Ansible automation for generic infrastructure components.

OpenShift Ansible

The core OpenShift Installation Playbooks including the supporting roles.

OpenShift Ansible Contrib

A repository of extra, unsupported, and upstream Ansible roles and playbooks for OpenShift.

Note
The dependencies are managed using ansible-galaxy and the specific instructions will call this out when there is a need to use galaxy to pull in the correct dependencies.

Automation of OpenShift Cluster Content

The openshift-applier is used to automate the seeding of OpenShift cluster content based on OpenShift templates and parameters files.

casl-ansible's People

Contributors

bbeaudoin avatar bvkin avatar ckyriakidou avatar darthlukan avatar day4skiing avatar dtfranz avatar duritong avatar ericzolf avatar etsauer avatar garethahealy avatar gmontalvoy avatar infosec812 avatar jaykayy avatar jtudelag avatar makentenza avatar mbach04 avatar mmckinst avatar mzamot avatar oybed avatar pabrahamsson avatar raffaelespazzoli avatar rohitmusti avatar sabre1041 avatar sherl0cks avatar srgvg avatar themoosman avatar tomassedovic avatar tylerauerbeck avatar victorock avatar vvaldez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

casl-ansible's Issues

aws-provisioning: Delete cluster does not free up all resources

When deleting a cluster in AWS, it does not free up resources such as volumes, elastic IPs, etc. This needs to be fixed. This is most likely taken care of if/when moving to using AWS CloudFormation for provisioning, but if this doesn't happen, the delete role should ensure to free up all resources that were created for a cluster.

DNS / Route53 is another component that also needs to be cleaned up

Document inventory variables

To allow for additional clarity for provisioning cluster, provide documentation into the inventory variables that are available for provisioning.

Add wildcard routes to private network

Currently, wildcard routes are not resolvable from within the private network. This makes invocations from within the OpenShift environments to routes impossible

openshift-applier: clean-up errors for URL checks

As part of the task to check if a passed in template is a url or local file, we should use failed_when to avoid printing red failure messages, or even consider something like method: HEAD with the url module (as described here.

Port heat stack implementation to os_* modules

Product direction is to steer away from individual clouds' provisioning/templating mechanisms. As such, we should replace our heat-based server provisioning with using the native ansible os_server, os_volume, etc.

openshift-applier: failure misleading if oc is not logged in

Steps to reproduce:

  • oc logout
  • run the role

Output:

TASK [openshift-applier : Create/Apply 'ci-cd.yml'] ********************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "oc create -f /home/jholmes/Code/cluster-contents/inventory/../namespaces/ci-cd.yml", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}

Expected Output:
something that tells me I'm not logged into oc

Ansible Version:

ansible 2.3.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Sep  5 2017, 08:53:59) [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]

aws-provisioning: Support custom hostnames

The AWS instances (as most public cloud providers do) are using hostnames tied to their IP/region, etc. -i.e.: ip-172-31-8-56.us-west-2.compute.internal ... this isn't ideal when it comes to naming the hosts within OpenShift. Just like we do for OpenStack, it would be preferred to have the hostnames reflect the role of the instance - i.e.: master, infra-node, app-node, etc.

openshift-applier reports task as 'changed' when ignoring 'Already Exists' errors

When objects are created like:

TASK [openshift-applier : Create OpenShift objects based on static files for 'namespace'] *************************************************************************************************************************
changed: [master-0.sample.casl.example.com] => {"changed": true, "cmd": ["oc", "create", "-f", "https://raw.githubusercontent.com/redhat-cop/cluster-lifecycle/inception-poc/namespaces/myapp-dev.yml"], "delta": "0:00:00.215057", "end": "2017-10-05 22:52:22.301717", "failed": false, "failed_when_result": false, "rc": 1, "start": "2017-10-05 22:52:22.086660", "stderr": "Error from server (AlreadyExists): namespaces \"myapp-dev\" already exists\nError from server (AlreadyExists): rolebinding \"system:image-pullers\" already exists\nError from server (AlreadyExists): rolebinding \"system:image-builders\" already exists\nError from server (AlreadyExists): rolebinding \"system:deployers\" already exists\nError from server (AlreadyExists): rolebinding \"admin\" already exists", "stderr_lines": ["Error from server (AlreadyExists): namespaces \"myapp-dev\" already exists", "Error from server (AlreadyExists): rolebinding \"system:image-pullers\" already exists", "Error from server (AlreadyExists): rolebinding \"system:image-builders\" already exists", "Error from server (AlreadyExists): rolebinding \"system:deployers\" already exists", "Error from server (AlreadyExists): rolebinding \"admin\" already exists"], "stdout": "", "stdout_lines": []}

The task reports as changed, when no changes actually took place

Install fails if openshift_master_cluster_public_hostname not set

I think this is actually a contrib issue now, but need to look into it further.

Failure summary:

  1. Host:     localhost
     Play:     localhost
     Task:     openshift-ansible-contrib/roles/dns-records : Add public master cluster hostname records to the private A records (single master)
     Message:  The conditional check 'hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined' failed. The error was: error while evaluating conditional (hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined): list object has no element 0
               
               The error appears to have been in '/tmp/src/casl-ansible/roles/openshift-ansible-contrib/roles/dns-records/tasks/main.yml': line 12, column 3, but may
               be elsewhere in the file depending on the exact syntax problem.
               
               The offending line appears to be:
               
               
               - name: "Add public master cluster hostname records to the private A records (single master)"
                 ^ here

add support for an NFS role

the NFS role should allow to create an NFS server that then is configured by the openshift-ansible playbook

Update DNS record generation to use nsupdate

oc-apply: Need overall better error handling

oc-apply needs to check for the existence of files (local or remote/url) and error out with a proper error message. This should also be applied to a check for the NAMESPACE parameter to ensure it is set in the parms file.

openshift-applier: Allow some content to be "created" instead of "applied" for idempotency

When using oc-applier to create persistent databases with generate credentials, subsequent runs of the inventory will overwrite the secrets stored in OpenShift but have no effect on the database itself. I propose added an optional field in the inventory so that a particular template is applied once and only once on a given cluster. For example:

- object: someobjects
  content:
  - name: ephemeraldb
    template: openshift//mysql-ephemeral
    namespace: my-project
    params: "{{ inventory_dir }}/../params/ephemeraldb/build_params"
  - name: persistentdb
    template: openshift//mysql-persistent
    namespace: my-project
    params: "{{ inventory_dir }}/../params/persistentdb/build_params"
    idempotent: true

Inside of of this project, we create a copy of roles/oc-apply/tasks/process-content.yml and name it roles/oc-apply/tasks/process-idempotent.yml. This task will be modified to ONLY run when idempotent is defined and the original will be modified to ONLY run when idempotent is undefined. The new task will use oc create along with oc process instead of using oc apply. The new task would also swallow errors related to the objects already existing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.