Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

some variables do not exist when 'gather_facts' is set to no #46

Closed
rolfvreijdenberger opened this issue Feb 12, 2018 · 6 comments
Closed

Comments

@rolfvreijdenberger
Copy link

In 'tasks/unattended-upgrades.yml' there are variables used from the host being provisioned.
in case you do not have those variables, those ansible facts are not present and provisioning fails.
a warning/message OR sensible defaults might make sense to implement.

thanks for a nice package guys!

@jnv
Copy link
Owner

jnv commented Feb 12, 2018

Hi Rolf, what use case is behind turning gather_facts off?

The role uses ansible_distribution and ansible_distribution_release facts to choose default origin patterns. I think the default variable could be empty and left unset if the default configuration is kept intact, i.e. #32.

@BarbzYHOOL
Copy link
Contributor

Yeah, should turn gather_facts on (only off for testing imo)

@lonix1
Copy link

lonix1 commented Sep 3, 2019

I agree. The use case is you are provisioning a new server, so you must turn off gather_facts. But if you use this module as part of the provisioning process (makes sense to do so), then there are no facts.

I suppose we could manually define the variables in such a case. Which variables do I need to define?

@jnv
Copy link
Owner

jnv commented Sep 3, 2019

@lonix1 See my previous comment, facts are used to detect distribution and version. I will be happy to accept a PR to allow the role to work without gather_facts as long as the default behavior is kept intact and the new feature is properly tested and documented.

Still I am not sure what's the issue with facts during bootstrapping. I understand you need to setup Python on the target system, but can't you gather facts after (e.g. by running the setup module in your playbook)?

@lonix1
Copy link

lonix1 commented Sep 3, 2019

Yeah you are right there are workarounds, so it's not a big problem. And I'm manually defining those variables for now, so it works for me.

@jnv
Copy link
Owner

jnv commented May 23, 2022

I am closing this issue since this role has been deprecated. Feel free to suggest alternatives in #98.

@jnv jnv closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants