-
Notifications
You must be signed in to change notification settings - Fork 95
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
AnsibleUndefinedVariable: 'postgres_password' is undefined #169
Comments
Can you show me what your inventory looks like? This likely relates to a concern @ticoombs brought up in that PR. The file should automatically be imported--assuming the inventory hostname matches your For example, in testing, I use hosts[lemmy]
foss.ly ansible_user=root domain=foss.ly letsencrypt_contact_email=cody@blahblah.com lemmy_base_dir=/srv/lemmy
The assumption I was making was the hostname in the inventory would match As such, we should avoid making this assumption or document things accordingly. Mea culpa @ticoombs :( |
Oh lol, I was running this completely locally on my Windows machine using WSL and Vagrant. I just kept my PC's name in the inventory and something random as the domain as I thought that wouldn't matter, and I've setup workarounds to bypass certificates ¯\_(ツ)_/¯
I can confirm this worked after doing a host entry to my machine as the domain name I chose and configuring that domain name in the inventory/hosts file...
|
I'm not sure if the current setup will work on more... let's say exotic installs, like if someone decides to deploy a lemmy instance which is load balanced across servers. I mean I have no idea if the rest of the lemmy infrastructure can actually handle this setup but let's assume it can :D I haven't tried this out much, but maybe instead of Not sure how that will affect the rest of the files already in host_vars though, that will need looking at. And using |
I spent some time on this today and I believe there are some issues with the new vars.yml system for existing installs of lemmy-ansible.
Obviously For those seeing the error in the title, change your |
The |
These are not exotic installs but regular installs which we have no control over. As @RedKrieg also surmised we were never using host_vars correctly before and always imported the various variables that we needed. The folder "host_vars" was never used for the hosts. Forcing our ansible code to be on a single-homed host also reduces the flexibility of the code. Sure at the moment we are non-HA, but with the changes pictrs is making, we could easily be HA after that (assuming people don't use our postgres and use a hosted db service which others already do). While there isn't a plan set forth it is worth having it in the back of the mind. I like @sanatsathaye 's idea on using group vars. To build on that instead of That would:
So I propose a 3 step solution:
This ensures that we no longer break existing ansible installs and people can get back to doing what they do best.
We also need to update the documentation and possibly at this point in time start versioning our pushes to main. I suggest making the previous commit (31631d2) v1.1.0 We need to start versioning to ensure we don't break peoples ci/cd pipelines.
host_vars are fine but group_vars is 👌 This can be scheduled as our (lemmy-ansible) next major release with notes on upgrading. Also as it currently stands we can easily backport the "version" fixes.
I know I've gone slightly off topic here but it seems as good as any place. |
+1 on the versioning of this installation guide, along with a documented changelog. These scripts have changed a lot in the past month and it would be quite problematic for people using this solution to upgrade existing installs if they're not made aware of the exact changes. Without that most would simply use a |
Yep I'd very much appreciate if someone could PR |
I'm going to close this in favor of #171 which was created from the discussion above. |
Got this when running both
lemmy.yml
andlemmy-almalinux.yml
I believe this is happening because our
vars.yml
is insideinventory/host_vars/{{ domain }}/
rather thaninventory/host_vars/
itself as per documentation.I already have a fix for this in my local machine:
That said I'm not sure if there are plans to change anything around variable centralisation again, or if anyone else has a suggestion to solve this in a different way so creating an issue for discussion.
The text was updated successfully, but these errors were encountered: