Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic-spring-boot fails to deploy jenkins when context not set to build namespace #133

Closed
bparry02 opened this issue May 7, 2020 · 0 comments · Fixed by #134
Closed

Comments

@bparry02
Copy link
Contributor

bparry02 commented May 7, 2020

In the applier manifest, the jenkins template is deployed, but no namespace is specified:

  - name: "deploy jenkins to build environment"
    template: "openshift//jenkins-ephemeral"
    tags:
      - build

This causes the template deployment to fail if the oc project is set to a deleted project, for example.

$ oc new-project my-newproject
$ oc delete project my-newproject
$ ansible-playbook -i ./.applier/ galaxy/openshift-applier/playbooks/openshift-cluster-seed.yml
...
TASK [openshift-applier : Apply OpenShift objects based on template with params for 'deployments : deploy jenkins to build environment'] ***
failed: [localhost] (item={'oc_path': ''}) => {"ansible_loop_var": "oc_param_file_item", "changed": true, "cmd": "oc process       openshift//jenkins-ephemeral            --ignore-unknown-parameters   | oc apply      -f -      \n", "delta": "0:00:02.483306", "end": "2020-05-07 09:55:17.817910", "failed_when_result": true, "msg": "non-zero return code", "oc_param_file_item": {"oc_path": ""}, "rc": 1, "start": "2020-05-07 09:55:15.334604", "stderr": "error: unable to process template\n  processedtemplates.template.openshift.io is forbidden: User \"bparry\" cannot create resource \"processedtemplates\" in API group \"template.openshift.io\" in the namespace \"my-newproject\"\nerror: no objects passed to apply", "stderr_lines": ["error: unable to process template", "  processedtemplates.template.openshift.io is forbidden: User \"bparry\" cannot create resource \"processedtemplates\" in API group \"template.openshift.io\" in the namespace \"my-newproject\"", "error: no objects passed to apply"], "stdout": "", "stdout_lines": []}

The workaround for this issue is to create the build project manually, before running the applier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant