epiphany icon indicating copy to clipboard operation
epiphany copied to clipboard

[BUG] Cloud specific tasks are skipped when `any` provider is used

Open to-bar opened this issue 3 years ago • 0 comments

Describe the bug Sometimes we use any provider also for cloud based env (e.g. when infrastructure is created by a module) but the provider property is used in source code, for example like this:

- name: Disable AWS cloud hostname
  lineinfile:
    dest: /etc/cloud/cloud.cfg
    line: 'preserve_hostname: true'
    state: present
  when:
    - provider == "aws"

How to reproduce Steps to reproduce the behavior:

  1. create infrastructure using aws-bi module
  2. edit Epiphany config file to use any provider
  3. execute epicli apply

Expected behavior When we run epicli on cloud based VMs, cloud specific tasks should not be skipped.

Environment

  • Cloud provider: AWS & Azure

Additional context More about the skipped task on AWS: https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/

More provider based code:

  1. In kubernetes_master role:
- include_tasks: "{{ specification.provider }}/kubernetes-storage.yml"
  when: specification.storage.enable
  1. In repository role:
- name: Bypass /etc/cron.daily/rhui-update-client
  when: specification.provider in ['azure', 'any']  # any for AzBI module
- name: Restore /etc/cron.daily/rhui-update-client
  when:
    - ansible_os_family == "RedHat"
    - specification.provider in ['azure', 'any']  # any for AzBI module

DoD checklist

  • Changelog
    • [ ] updated
    • [ ] not needed
  • COMPONENTS.md
    • [ ] updated
    • [ ] not needed
  • Schema
    • [ ] updated
    • [ ] not needed
  • Backport tasks
    • [ ] created
    • [ ] not needed
  • Documentation
    • [ ] added
    • [ ] updated
    • [ ] not needed
  • [ ] Feature has automated tests
  • [ ] Automated tests passed (QA pipelines)
    • [ ] apply
    • [ ] upgrade
    • [ ] backup/restore
  • [ ] Idempotency tested
  • [ ] All conversations in PR resolved

to-bar avatar Apr 09 '21 14:04 to-bar