GithubHelp home page GithubHelp logo

rht-labs / ansible-stacks Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 10.0 170 KB

Ansible playbook and roles used to creates stacks via push button infrastructure (PBI)

License: Apache License 2.0

Python 100.00%

ansible-stacks's People

Contributors

etsauer avatar mcanoy avatar mdanter avatar mscherer avatar oybed avatar sherl0cks avatar sirwalrus avatar tadityar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-stacks's Issues

Creation of a Project Should not drop me into that project.

When stacks goes through the project creation process, it runs oc new-project to do the project creation. This results in the logged in user being "dropped in" to the last project that gets created, which I think would be unexpected by the user. What we probably want to do is oc adm new-project which does not change the current project.

The merge of PR #84 broke ansible-stacks

@etsauer the latest PR broke normal operation of ansible-stacks - see below...

TASK [create-openshift-resources : include] ************************************
included: /home/obedin/ansible-stacks/roles/create-openshift-resources/tasks/create_environment_variables_string.yml for localhost

TASK [create-openshift-resources : Add variable to environment_variables_string] ***
fatal: [localhost]: FAILED! => {
    "failed": true
}

MSG:

The conditional check 'app.from_template is not defined and app.from_template == ''' failed. The error was: error while evaluating conditional (app.from_template is not defined and app.from_template == ''): 'dict object' has no attribute 'from_template'

The error appears to have been in '/home/obedin/ansible-stacks/roles/create-openshift-resources/tasks/create_environment_variables_string.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: "Add variable to environment_variables_string"
  ^ here


	to retry, use: --limit @/home/obedin/ansible-stacks/load_infra_local.retry

PLAY RECAP *********************************************************************
localhost                  : ok=39   changed=5    unreachable=0    failed=1   

Support PVC Association Overwrites Using A Non-Default Name

Failure Scenario

When a dockerfile declares a VOLUME, (e.g. Nexus ) the oc new-app command will create a deployconfig that generates the following:

      volumes:                                                                                                                                                                                                                         
      - name: nexus-volume-1                                                                                                                                                                                                           

In order for oc volume --add --overwrite to work properly (i.e. configure the volume association) the API object needs to use the same naming convention.

Enhancement Request
Add automation to detect this scenario and allow the configuration to be overwritten regardless of naming

Possible Impls

  • Delete the pvc on the DC and then add a new one

Related To
#66

Support Configurable Timeouts

Currently this is hardcoded, leaving the end user no recourse in scenarios where builds take longer than the provided defaults.

Do Not Attempt To Promote Images Which Where Not Built Via Ansible Stacks

The common example here is a database image, which ansible stacks will deploy but not associate with a build config. We should only promote image streams from one project to another in the event that the app has a build_tool defined and that build_tool != 'none'.

Without this logic, the playbook will fail because there was no image-stream created with the applications name in the source project.

Naming collision with ansible variables

We are passing in an engagement to ansible like so:

{
"openshift_clusters": { ...},
"users",
"groups"
}

This is causing a problem because access groups {{ groups }} is reserved for ansible

engagement should be at the root object to avoid namespace issues

Add smarts to configure_nexus URL parsing

Right now the impl prefixes http:// and postfixes /. We should add some string processing to remove these additions if the user provides them. In fact, the http:// should probably just go away so we can support https

Revisit Checks For create_preqs_for_pipeline.yml

The create_preqs_for_pipeline.yml task is responsible for creating service accounts to support image tagging as well as actually creating the tags which create image streams between projects. Right, the following conditional is evaluated before running this task, which doesn't seem to properly model the use case for deploying images from docker hub (e.g. nexus)

when: get_app_name_result.rc == 1 and project.environment_type is defined and project.environment_type == 'promotion' and app.name in imagestreams_to_promote

Support binary build of Java WAR s2i

Binary s2i builds for compiled languages need a hello-world app and ansible logic to deploy that app on resource creation because OCP should not be responsible for building this artifact. reference how this done with fabric8 s2i for fat jars in tasks/fabric8_java_s2i_build.yml

Investigate Why Ansible Is Resolving Variables on Skipped Tasks

This is producing warnings that are ominous like the below:

TASK [create-openshift-resources : include] ************************************
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.: 'openshift_resources' 
is undefined.
This feature will be removed in a future release. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

Model Templates As Part of Project

This feature will model templates as part of a project, not as an application. The current model is built around that applications are driven by oc new-app, and thus merging these two concepts is leading to conflicts as seen with #89 #88 #80. Modelling templates as part of a project allows use to clearly separate concerns in our model, as well as our implementation.

Optimize Such That All "Build" Stages Are Done in Parallel

A build stage denotes an openshift project that performs s2i such that the resulting image can be pushed other projects, called promotion stages. It is common to segregate multiple apps into different build stages to fence off resource quotas between apps. The current implementation will pause for all s2i builds in a single build stage to finish before moving on to the subsequent promotion stage. However; this means that if there are multiple build stages, their builds will happen in serial, which dramatically slows down the playbook.

To optimize around this, we would need to reorganize the playbook to create all build projects first, before creating any promotion projects. This is likely a significant refactor, so there needs to be a real business justification to do it.

Support Deploy of Docker Hub Images

Problem Description

To do this with oc new-app, you must support oc new-app <namespace>/<image>. Current impl only supports oc new-app --image-stream=<is>

Workaround

using scm_url will produce desired results

Related To
#67

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.