epiphany
epiphany copied to clipboard
[BUG] Cloud specific tasks are skipped when `any` provider is used
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:
- create infrastructure using
aws-bi
module - edit Epiphany config file to use
any
provider - 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:
- In
kubernetes_master
role:
- include_tasks: "{{ specification.provider }}/kubernetes-storage.yml"
when: specification.storage.enable
- 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