Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default for lxc_template_debootstrap_release #135

Closed
luken opened this issue Jan 30, 2018 · 4 comments
Closed

Provide default for lxc_template_debootstrap_release #135

luken opened this issue Jan 30, 2018 · 4 comments

Comments

@luken
Copy link

luken commented Jan 30, 2018

lxc_template_debootstrap_release: '{{ ansible_distribution_release }}'

Another item that is likely due to launching controller from within OSX.

The default behavior if no _release is specifically provided results in an empty ..._release variable and then this error, note the space before the comma.

Invalid release , valid ones are: squeeze wheezy jessie sid

lxc_template_debootstrap_release: '{{ ansible_distribution_release | default("stretch") }}'

I can submit a PR with the above change if you agree.

Next on the list is to figure out why the command below doesn't like stretch as a distro release. If anyone has any ideas.
$ lxc-create -n obj01 -t debops -f /etc/lxc/external.conf debootstrap is /usr/sbin/debootstrap Invalid release stretch, valid ones are: squeeze wheezy jessie sid lxc-create: lxccontainer.c: create_run_template: 1297 container creation template for obj01 failed lxc-create: tools/lxc_create.c: main: 318 Error creating container obj01

@luken
Copy link
Author

luken commented Jan 30, 2018

Updated above, removed the | mandatory as I had hacked up the template file on the LXC host and forgot about the edit, this was likely causing the "stretch" default to be set.

@drybjed
Copy link
Member

drybjed commented Jan 30, 2018

So you are saying that when you run Ansible from macOS, the ansible_distribution_release variable is what, empty? That's kinda weird, since Ansible is gathering facts from the remote host, not macOS. What happens if you run:

ansible <host> -m setup

Do you get "sane" facts, or are variables like ansible_distriburion, ansible_distribution_release, ansible_fqdn missing or empty? What OS release are you using on the remote host you run against?

In the above case I would probably go with the default() method, however ansible_distribution_release is kinda the default, and its a fact that should be defined by Ansible after facts are gathered. It being missing suggests that something is missing from the remote host that you are running against, and this might impact many more DebOps roles than just debops.lxc. I would try and fix this issue first.

@luken
Copy link
Author

luken commented Jan 30, 2018

The above Ansible command run from OSX properly comes back with stretch when run against the LXC host:
"ansible_distribution_release": "stretch",

other facts seem in order. I'll keep looking.

@luken
Copy link
Author

luken commented Jan 31, 2018

Pushed everything back up the hill, killed the mods to the defaults.yml, made sure there was on override being set in inventory, nuked /usr/share/lxc/templates/lxc-debops on the LXC host... and now it is getting set as expected in the template file... Closing issue till it repos.

DEFAULT_RELEASE="stretch"

used to be

DEFAULT_RELEASE=""

Now on to why stretch is not supported in the template file.

@luken luken closed this as completed Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants