Re: [ansible-project] How do i install an ansible galaxy role from a tar.gz file as non-root user ?

2020-08-17 Thread Luca 'remix_tj' Lorenzetto
On Sat, Aug 15, 2020 at 2:56 PM Hans Lammerts wrote: > Just discovered that the command > > ansible-galaxy install dsglaser-cis_security-1.2.0.tar.gz -p ./bla > > does work, but only as root. And that's not what I want... > > What am I doing wrong ? It's very strange, maybe ./bla directory is roo

[ansible-project] How to add var file in task level and not playbook level

2020-08-17 Thread דודו דודו
This is not working Thanks - name: Update server etc/host vars_files: /opt/defaults/defaults.yml lineinfile: path: /etc/hosts line: "{{ external_address }}{{ service_name }}" state: present backup: yes -- You received this message because you are subscribed to

[ansible-project] install ansible system wide

2020-08-17 Thread Manuel Sopena Ballesteros
hi, I just realised that ansible installs on user home folder ``` $ whereis ansible-playbook ansible-playbook: /home/msopena/.local/bin/ansible-playbook ``` how can I install ansible system-wide so I can install it once and any user can use it? thank you -- You received this message because

Re: [ansible-project] install ansible system wide

2020-08-17 Thread Dick Visser
How did you install it? On Mon, 17 Aug 2020 at 09:53, Manuel Sopena Ballesteros wrote: > > > hi, > I just realised that ansible installs on user home folder > ``` > $ whereis ansible-playbook > ansible-playbook: /home/msopena/.local/bin/ansible-playbook > ``` > how can I install ansible system-wi

[ansible-project] Passing encrypted password to playbook using --ask-become-pass option

2020-08-17 Thread kulal.k...@gmail.com
Hello, I am trying to pass the encrypted password to execute my playbook and while doing so I see below error. Error: FAILED! => {"msg": "The field 'become_pass' has an invalid value, which includes an undefined variable. The error was: 'ansible_password' is undefined"} My Host file named

Re: [ansible-project] Re: Ansible Windows Deployment - 'Connection aborted.', error(104, 'Connection reset by peer')

2020-08-17 Thread Tony Wong
i dont understand what this mean You need both the hotfix and the registry keys set for the connection to break like this, having one or the other is not enough. A On Sun, Aug 16, 2020 at 5:40 PM Tony Wong wrote: > I have same problem. I enabled winrm over https and i can see it listen to > 598

[ansible-project] Ansible inventory duplicate hosts in different groups - Ansible picks the last one from the duplicates

2020-08-17 Thread Abhishek Sharma
Hi I have an inventory defined as below: [A] host1.example.com lhost=1010 host2.example.com lhost=1110 [B] host1.example.com lhost=2010 now when i run below command on group A for host1.example.com ansible picks up the host in group B # ansible -i inventory A -m shell -a "ls -l /tmp/{{ lhost

[ansible-project] Re: Ansible inventory duplicate hosts in different groups - Ansible picks the last one from the duplicates

2020-08-17 Thread Abhishek Sharma
updated command is # ansible -i inventory A -m shell -a "ls -l /tmp/{{ lhost }}" --limit host1.example.com On Monday, August 17, 2020 at 7:46:00 PM UTC+5:30 Abhishek Sharma wrote: > Hi > > I have an inventory defined as below: > > [A] > host1.example.com lhost=1010 > host2.example.com lhost=

Re: [ansible-project] Tags or Variables, not sure which way to go

2020-08-17 Thread alicia
Hi John, The opposite of “- -tags my_tag” is “—skip-tags my_tag” - see the updated documentation on tags at https://docs.ansible.com/ansible/devel/user_guide/playbooks_tags.html . You would, of course, need to add tags to y

Re: [ansible-project] Tags or Variables, not sure which way to go

2020-08-17 Thread John Petro
Thanks for the response. I did see that this morning, but hadn't had a chance to test it out yet. I"ll give that option a shot and see if it's better than the variable method I ended up writing. --John On Mon, Aug 17, 2020 at 1:18 PM alicia wrote: > Hi John, > > The opposite of “- -tags my_ta

[ansible-project] Using ansible to hardening Linux Systems Remotely

2020-08-17 Thread giovanni baldi
I'm new of the Ansible World, and for the moment i used just to hardening some linux systems using every time the command locally: *ansible path_to_my_playbook.yml* There is a way to run this commant to a remote computer? i tried adding a remote computer in the hosts files but or i make a mi

Re: [ansible-project] Using ansible to hardening Linux Systems Remotely

2020-08-17 Thread Mauricio Tavares
On Mon, Aug 17, 2020 at 2:16 PM giovanni baldi wrote: > > > I'm new of the Ansible World, and for the moment i used just to hardening > some linux systems using every time the command locally: > >> ansible path_to_my_playbook.yml > > > There is a way to run this commant to a remote computer? i t

Re: [ansible-project] Re: 2 levels nested loop with variables

2020-08-17 Thread Nick-H
Thanks Racke, I should have had some context. policy_name can vary, actually in the real task I have other policies with other names, hence the use of a loop for item.name and item.policy . Just this specific one named rds_foo_bar needs the nested arguments from my vars list(or dict I am not su

Re: [ansible-project] Using ansible to hardening Linux Systems Remotely

2020-08-17 Thread giob...@gmail.com
Sorry i made a mistake..i used the command *ansible-playbook path_to_my_playbook.yml* and in the hosts files i added the hostname and then the IP address of the remote Computer where i want apply the configurations. But does not work:-( Il giorno lunedì 17 agosto 2020 alle 20:31:4

Re: [ansible-project] Using ansible to hardening Linux Systems Remotely

2020-08-17 Thread Mauricio Tavares
On Mon, Aug 17, 2020 at 4:58 PM giob...@gmail.com wrote: > > Sorry i made a mistake..i used the command > > ansible-playbook path_to_my_playbook.yml > > and in the hosts files i added the hostname and then the IP address of the > remote Computer where i want apply the configurations. But does

Re: [ansible-project] Using ansible to hardening Linux Systems Remotely

2020-08-17 Thread John Petro
Can you post the output with the error message you are getting? --John On Mon, Aug 17, 2020 at 5:05 PM Mauricio Tavares wrote: > On Mon, Aug 17, 2020 at 4:58 PM giob...@gmail.com > wrote: > > > > Sorry i made a mistake..i used the command > > > > ansible-playbook path_to_my_playbook.yml >

Re: [ansible-project] Re: 2 levels nested loop with variables

2020-08-17 Thread Nick-H
so basically I *just *need to loop over extra variables in an inline way to construct the unique name and the unique policy template, then, the usual loop for the module will create the resources in aws. - should using *Lookup *a good start for inline loop ? - as *nested *and *subelements *can

Re: [ansible-project] Ansible inventory duplicate hosts in different groups - Ansible picks the last one from the duplicates

2020-08-17 Thread alicia
The host host1.example.com is listed in both group A and group B - the only difference is the value of the variable ‘lhost’. Ansible is executing on the correct host, host1.example.com , but with the variable value from the list ing group

Re: [ansible-project] Re: 2 levels nested loop with variables

2020-08-17 Thread Dick Visser
For several levels of loops I often split things out to separate files, which are then included with 'include_tasks' in a loop. It helps to name the files properly, ie according to their function. On Mon, 17 Aug 2020 at 23:15, Nick-H wrote: > so basically I *just *need to loop over extra varia