Re: [ansible-project] Reading in extra files, as or into dicts?

2022-04-16 Thread Richard Hector
On 16/04/22 22:13, Richard Hector wrote: Hi all, I have created a directory 'users' alongside my inventory. It has a directory 'user_vars', intended to be used like host_vars, but for users, obviously. In there, I have files like this: = --- name: richard gecos

[ansible-project] Reading in extra files, as or into dicts?

2022-04-16 Thread Richard Hector
Hi all, I have created a directory 'users' alongside my inventory. It has a directory 'user_vars', intended to be used like host_vars, but for users, obviously. In there, I have files like this: = --- name: richard gecos: 'Richard Hector,,,' shell: '/bin/bash' ssh_keys

Re: [ansible-project] Keeping inventory and other data separate from code

2022-04-16 Thread Richard Hector
On 2/04/22 16:07, Nico Kadel-Garcia wrote: On Fri, Apr 1, 2022 at 10:27 PM Richard Hector wrote: Hi all, Currently my inventory is stored in the same git repo as my play(book)s, roles etc, which I don't like. Consider using git submodules if you want a unified workspace. Hmm. I got

Re: [ansible-project] [OT?] What do you call a container container?

2022-04-16 Thread Richard Hector
uot;Turtles All The Way Down". "The inevitable product of people taught only recursion as a valid way to do anything" "Pay no attention to that server behind the layer of abstraction" The list could go on and on, much like what you're describing. On Fri, Apr 1, 2022 at 5:46 P

[ansible-project] Keeping inventory and other data separate from code

2022-04-01 Thread Richard Hector
Hi all, Currently my inventory is stored in the same git repo as my play(book)s, roles etc, which I don't like. What are common ways to avoid this? Perhaps keep inventory in a subdir which is .gitignored, and make that a separate repo? I also want to keep data which is not strictly

[ansible-project] [OT?] What do you call a container container?

2022-04-01 Thread Richard Hector
Hi all, I have several leased VPS in which I run LXC containers. At the moment, the group I use for those is "lxc_hosts", but that has a few problems: - Everything in inventory is a host, so lxc_host could just as well be a container as the machine it lives on. - Separators in general are

[ansible-project] lineinfile in lxc_container?

2021-11-18 Thread Richard Hector
Hi all, I'm using ansible to set up lxc containers, using delegation to the container host. One task looks like this: - name: add ansible user to sudoers lineinfile: dest: "/var/lib/lxc/{{ inventory_hostname }}/rootfs/etc/sudoers" state: present regexp: "^ansible" line:

Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-18 Thread Richard Hector
On 18/05/21 2:24 am, Brian Coca wrote: For data manipulation you want to create a filter plugin, you still need to be explicit about the data you feed it. Thanks for that - this is what I've ended up with. There's probably some copy/paste boilerplate that's not needed in my case. Does it

Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-17 Thread Richard Hector
On 15/05/21 6:39 pm, Richard Hector wrote: Do I need to write a custom plugin of some kind? I'm experimenting with writing a vars plugin, referring to these: https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html https://github.com/ansible/ansible/blob/devel/lib/ansible

Re: [ansible-project] Complex process to generate template/lineinfile data?

2021-05-15 Thread Richard Hector
On 15/05/21 6:39 pm, Richard Hector wrote: Any suggestions? Is this stuff reasonable to do with ansible, and a templating language? Do I need to write a custom plugin of some kind? If I had a dynamic inventory, then I could probably generate extra variables at that stage, but that's further

[ansible-project] Complex process to generate template/lineinfile data?

2021-05-15 Thread Richard Hector
Hi all, Well, it's not really that complex, but seems complex to do within the constraints of ansible/jinja. My scenario is that I run dirvish to back up multiple containers on multiple hosts. The containers are backed up via the filesystems on the hosts. The root filesystem of the

Re: [ansible-project] best way to go about dhcp

2018-05-16 Thread Richard Hector
On 16/05/18 04:56, lpescatore via Ansible Project wrote: > Hi, Posting a hypothetical.  > Since my windows environment relies on a hosts file with addresses in > said file,  > what do you do when your environment is dhcp? Like if the IPs keep > changing, whats to be done in the hosts file? So the

Re: [ansible-project] Need help in updating /etc/grub.conf file to disable THP in linux server using Ansible

2018-05-15 Thread Richard Hector
On 15/05/18 18:23, Padmesh Singh wrote: > I need help in updating /etc/grub.conf file to disable THP in Linux servers. > I used below Ansible lineinfile module but it updates the kernel line > everytime when I run it, I need which runs and updates every line of kernel > in /etc/fstab file.

Re: [ansible-project] Unable to install through dpkg in Ansible

2018-05-09 Thread Richard Hector
On 06/05/18 05:22, Bishwajit Samanta wrote: > Hi,  > > I am trying to install a .deb Package through Ansible, it is not getting > installed.  > > Error:- > -- > > TASK [recon_app : Install the Deb Package of ReconApp] > *** > Saturday

Re: [ansible-project] Unable to run playbook (Syntax Error)

2018-04-30 Thread Richard Hector
On 01/05/18 09:26, Joshua Hill wrote: > Can someone show me where my mistakes are with the below playbook? When i > try to run this playbook it tells me it fails at > > - name: run multiple commands on remote nodes > ^ here > > --- > - name: get version > hosts: all > gather_facts:

Re: [ansible-project] Re: Hosts behind ssh-proxy

2018-04-28 Thread Richard Hector
On 29/04/18 03:28, Sosys wrote: > try this: > https://groups.google.com/forum/?utm_medium=email_source=footer#!msg/ansible-project/-AFEyk69T8k/0X9skiOXCQAJ Or if you have a recent enough OpenSSH (7.3), you can use ProxyJump, which is much simpler: # from #

Re: [ansible-project] lxc connection plugin - does anyone use it?

2018-04-10 Thread Richard Hector
On 10/04/18 21:57, Kai Stian Olstad wrote: > On 10.04.2018 11:47, Richard Hector wrote: >> I can't see how to use this at all without being root. > > Add your user to the lxd group (your distro might use another group name > for access) I have no lxd group; I'm not using lxd.

Re: [ansible-project] lxc connection plugin - does anyone use it?

2018-04-10 Thread Richard Hector
I can't see how to use this at all without being root. Is it considered acceptable to email the plugin author directly? Thanks, Richard On 08/04/18 00:28, Richard Hector wrote: > Hi all, > > I'm trying to use the lxc connection plugin, but it says that my > container isn't running

Re: [ansible-project] ansible handling stdin input

2018-04-09 Thread Richard Hector
On 09/04/18 21:57, Benny Kusman wrote: > Hi  > > Hopefully someone has encountered and resolved this issue. > > supposedly my playbook: > *- main: execute script* > *  shell: "/home/settingip"* > > when executing the program, it will run and require stdin/keyboard > input, such as IP, hostname,

[ansible-project] lxc connection plugin - sudo first?

2018-04-07 Thread Richard Hector
Hi all, I'm trying to use the lxc connection plugin, but it says that my container isn't running. Presumably that's because ansible isn't running as root. Is there a way to tell it to sudo before connecting? I'm aware of course of how to sudo _afterwards_, ie on the target system, to do anything