Skip to content

BuildConfig (openshift_v1_build_config) module issues #75

@jcpowermac

Description

@jcpowermac

When using the openshift_v1_build_config in fusor/apb-base there are multiple issues.

Task

- name: Create BuildConfig                                                                                                                                                                                                                            
  openshift_v1_build_config:
    name: "{{ jenkins_service_name }}"
    namespace: "{{ namespace }}"
    spec_output_to_kind: "ImageStreamTag"
    spec_output_to_name: "jenkins:latest"
    spec_source_context_dir: "{{ source_context_dir }}"
    spec_source_git_uri: "{{ source_git_uri }}"
    spec_source_git_ref: "{{ source_git_ref }}"
    spec_source_type: "Git"
    spec_strategy_source_strategy__from_kind: "ImageStreamTag"
    spec_strategy_source_strategy__from_name: "jenkins:2"
    spec_strategy_source_strategy__from_namespace: "openshift"
    spec_triggers:
      - type: ConfigChange
      - type: ImageChange
    state: "{{ state }}"
    debug: True
  when: source_git_uri is defined and
        source_git_ref is defined and
        source_context_dir is defined
  ignore_errors: True

Result:
Incorrect JSON for BuildConfig see:
https://gist.github.com/jcpowermac/e24365ef4837cdc89bd004424bbbf07a
look for _from

Tasks

- name: Template - Create BuildConfig
  template:
    src: buildconfig.yaml.j2
    dest: /tmp/buildconfig.yaml
  register: buildconfig
  when: source_git_uri is defined and
        source_git_ref is defined and
        source_context_dir is defined

- name: Create BuildConfig
  openshift_v1_build_config:
    name: "{{ jenkins_service_name }}"
    namespace: "{{ namespace }}"
    debug: True
    src: "{{ buildconfig.dest | default(buildconfig.path) }}"
    state: "{{ state }}"
  when: source_git_uri is defined and
        source_git_ref is defined and
        source_context_dir is defined

Results:

TASK [provision-jenkins-apb : Create BuildConfig] ****************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error parsing resource definition. Encountered spec_strategy_source_strategy_from_kind, which does not map to a module parameter. If this looks like a problem with the module, please open an issue at github.com/openshift/openshift-restclient-python/issues"}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions