agnosticd icon indicating copy to clipboard operation
agnosticd copied to clipboard

Get rid of 'ec2_ami_facts' module renamed to 'ec2_ami_info' warning

Open ericzolf opened this issue 5 years ago • 10 comments
trafficstars

TASK [infra-ec2-template-create : Get all custom AMI for this specific ( envtype / version / stage ) - plan A] ******** Thursday 23 January 2020 11:40:03 -0500 (0:00:00.067) 0:00:07.219 ****** [DEPRECATION WARNING]: The 'ec2_ami_facts' module has been renamed to 'ec2_ami_info'. This feature will be removed in version 2.13. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

ericzolf avatar Jan 23 '20 16:01 ericzolf

This will break deployment. We are not on ansible 2.9 yet...

wkulhanek avatar Jan 23 '20 17:01 wkulhanek

This is an interesting process topic: in the agnosticd workshop, we just noticed that one construct was beyond obsolete with 2.9, there were surely warnings for months but they couldn't be addressed at the beginning because you were still on an older version of Ansible and then it was forgotten/ignored even though it could have been addressed with Ansible 2.7 (which I think is the version you are on).

I think you should tag such issues about deprecation warnings with an Ansible version and address them once you've migrated to this Ansible version. So, for example, tag this issue with "ansible_2.9" and ignore it until you've migrated to 2.9, where you could address it before 2.13 is out and starts to impact developers using more recent versions of Ansible.

ericzolf avatar Jan 23 '20 19:01 ericzolf

Now that we have an easy way to deploy using python virtualenv, fixing the deprecation warning should not be an issue anymore.

I'm happy to move this forward and accept a PR :)

If dev is broken because it uses a local python and ansible version of the deployer host, we can switch the catalog item to use virtualenv.

fridim avatar Mar 23 '20 08:03 fridim

Hi all,

Sorry for disturbance, if I understand correctly, now that standard deployments can be through virtualenv with their own ansible version there's no need to keep ec2_ami_facts and can be renamed to _info.

gmontalvoy avatar Mar 31 '20 20:03 gmontalvoy

@fridim We'd have to change all configs to use virtualenvs before we accept this PR.

Or update the deployer hosts with 2.9....

wkulhanek avatar Mar 31 '20 20:03 wkulhanek

Not necessarly. We can deal with it in ansible


- when: ansible_version.full is version_compare('2.9', '>=')
  include_tasks: <<ec2_ami_info tasks>>

# TODO: remove when not needed anymore
- when: ansible_version.full is version_compare('2.9', '<')
  include_tasks: <<ec2_ami_facts tasks>>
  

fridim avatar Mar 31 '20 21:03 fridim

We could. But man. That's a LOT of locations where we'd have to do that. This 'facts' -> 'info' rename is pervasive. k8s_info, os_project_info, ...

wkulhanek avatar Mar 31 '20 21:03 wkulhanek

Oh, i was only talking about ec2_ami_facts, as this issue is for that specifically

fridim avatar Apr 01 '20 07:04 fridim

I agree that for the rest, and fixing all the deprecation warnings is not something we're going to tackle in one change

fridim avatar Apr 01 '20 07:04 fridim

i forgot to add a comment here:

i tested ec2_ami_info with the version that is on our deployer server, and it just produces an error.

fridim avatar Apr 01 '20 19:04 fridim