Re: [ansible-project] Use of Ansible under PowerVC

2019-01-16 Thread Hugo Gonzalez
Hello Bernard, On 1/16/19 4:19 PM, Bernard Tremblay wrote: Hi, We are trying to use ansible in a PowerVC environment. We have a cluster of Power machines connected to a SAN box, we run SLES linux and Windows server to use SAP stuff. I would like to find any

Re: [ansible-project] alternate shadow file?

2019-01-17 Thread Hugo Gonzalez
If there is a complete chroot environment under /mnt/pxe, you could configure a new ansible user to always log into a chrooted environment, using a sshd_config file and these two lines: Match User new_ansible_user ChrootDirectory /mnt/pxe Then use ansible normally under that special user.

Re: [ansible-project] How to import/load env/ini file that is located in file on the Remote/Target server?

2019-01-14 Thread Hugo Gonzalez
Hi Chaz, On 1/14/19 11:02 AM, Chaz_E wrote: I like the idea of this suggestion. Is local-facts-facts-d  usable as Non-Root? They come up as part of the dictionary returned by the setup module

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-07 Thread Hugo Gonzalez
quot;: "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_ssh_host_key_ecdsa_public'"} On Jan 4, 2019, at 11:47 AM, Hugo Gonzalez <mailto:hgonz...@redhat.com>> wrote: -- You received this message because you are subs

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-04 Thread Hugo Gonzalez
Hello Freddie On 1/3/19 5:23 PM, Freddie Eisa wrote: What version are you running? The linux host is centos7.6 Ansible is 2.5.1, managed hosts are two Centos 7.6 cloud servers in my tests. I tried the following: - gather facts (automatic) - locally render the template *on the controlling

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-04 Thread Hugo Gonzalez
template: {% for host in groups['all'] %} {{ hostvars[host]['ansible_facts']['ssh_host_key_ecdsa_public'] }} {% endfor %} This template also works for me, and the keys are different. So you might want to try it: {% for host in groups['all'] %} {{

Re: [ansible-project] How to import/load env/ini file that is located in file on the Remote/Target server?

2019-01-10 Thread Hugo Gonzalez
Hello Chaz, On 1/10/19 11:00 AM, Chaz_E wrote: QUESTION: How can we load or import an env/ini file that is located in a file on the Remote/Target server? GOAL: We have an env/ini file on the remote/target server. We want to read in that file and use the values as variables for the tasks on

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
Got to be something else. Are these linux hosts? I tried this and it works: playbook: --- - hosts: all   tasks:     - template:     src: template.j2     dest: /tmp/knownhosts template: {% for host in groups['all'] %} {{

Re: [ansible-project] Inventory scripts: How to add debug info when run via Ansible?

2019-01-03 Thread Hugo Gonzalez
Hi Jimmy, On 12/27/18 5:57 AM, Jimmy Htor wrote: Hey, The way I see it you either output to STDOUT, which would make debug output part of the inventory data, thus corrupt it. Or you output to STDERR and Ansible will treat is as actual errors (and show it using red color). Is there another

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
On 1/3/19 3:34 PM, Freddie Eisa wrote: So it depends on the host and how they are named and was really a test case. The one I’m really concerned about is this one now {% for host in groups['servers_production'] %} {{ hostvars[host]['ssh_host_key_ecdsa_public'] }} {% endfor %} I think you

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
Hello Freddie, On 1/3/19 12:04 PM, Freddie Eisa wrote: {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'eth0'"} How do you know what to look for in ansible_facts? Run the setup module against your managed hosts and see what the facts look like. I

Re: [ansible-project] AnsibleUndefinedVariable: 'dict object' has no attribute

2019-01-03 Thread Hugo Gonzalez
On 1/3/19 4:26 PM, Freddie Eisa wrote: I had tried but still receive fatal: [server]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'ssh_host_key_ecdsa_public'"} Please post the play you're using, or at least the relevant task and template.

Re: [ansible-project] expect Module in Ansible

2019-02-27 Thread Hugo Gonzalez
Hello Deepak, On 2/27/19 7:43 AM, Deepak Sharma wrote: I am using expect   module to install one TIBCO products , - name: Start Streambase installation   expect:     echo: yes     chdir: /opt/tibco//{{ env }}/install     command: ./TIB_sb-cep_{{

Re: [ansible-project] problem: changing account password with ansible on aix

2019-02-12 Thread Hugo Gonzalez
The method for salting and hashing the password is probably different in AIX, remember you's passing a hashed password and that's platform dependent. You will have to find a way to do that for AIX. There's some information in the following links

Re: [ansible-project] Re: Ansible - write only specific output

2019-02-13 Thread Hugo Gonzalez
Hello, I've seen this use case before. It's easier to build the reporting directly into the playbook. You can, for exmaple, create a template that will print what you want for each managed host, and assemble the pieces later: On 2/13/19 11:55 AM, DM wrote: The example below is a yaml file

Re: [ansible-project] select one and two caracter of variable

2019-02-13 Thread Hugo Gonzalez
On 2/13/19 3:26 AM, ryad9200...@gmail.com wrote: Hi all, I don't now why this task not works: - set_fact:       my_variable: "{{ ansible_user[0 and 1] + 'gis' if ansible_user!='wildfly' else 'wildfly' }}" But *ansible_user[0] + ansible_user[1]* works but i want one syntaxe shorter,

Re: [ansible-project] Password change automation

2019-01-25 Thread Hugo Gonzalez
The password field must be hashed for all unices. You’re using plaintext for that. The ansible docs: Optionally set the user's password to this crypted value. On macOS systems, this value has to be cleartext. Beware of security issues. To create a disabled account or Linux systems, set this to

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Hugo Gonzalez
Hello Deepak, You're not following the right syntax for a YML inventory. Check the following link: https://docs.ansible.com/ansible/latest/plugins/inventory/yaml.html I don't know what you're trying to do with the " 2022" string there. It's not valid yaml. According to the docs in the

Re: [ansible-project] assert vs fail

2019-07-12 Thread Hugo Gonzalez
Hi, On 7/12/19 10:12 AM, S C Rigler wrote: Is there any advantage to using the assert module vs the fail module to bail out of a play if an expected condition isn't met? I don think there's a technical advantage, but the concepts are different: * use assert for checking against abnormal

Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-12 Thread Hugo Gonzalez
On 2/11/20 6:23 AM, 'deewon' via Ansible Project wrote: I got to the bottom of this eventually :) The task was running on the controller which didn't have a /dev/sdc device :) Whoa! careful there! :) Hugo G. -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] Templating error with Ansible 2.9 or higher

2020-02-21 Thread Hugo Gonzalez
On 2/19/20 8:02 AM, harry devine wrote: I'm using the Satellite6 Content Views role found here: https://galaxy.ansible.com/ahuffman/satellite6_manage_content_views. It works on Ansible up to 2.8.6, but any version after that gives the following error: TASK [satellite6_manage_content_views

Re: [ansible-project] Re: How to source a file which contains environment variables in a linux

2020-02-21 Thread Hugo Gonzalez
On 2/20/20 3:53 AM, Sivaraman P wrote: Gopi Krishna, Did you got any solution for this? Now I was in the same situation. I can expect that any statements executed within the same shell task will have access to the variables, but nowhere else in the system. What happens if you do the

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Hugo Gonzalez
Without knowing anything about how you got those values, it would be {{ query_result.msg | join(' ') }} Hugo G. If I do     - local_action:         copy content={{query_result.msg}} dest=/home/ansible/Playbooks/{{sname}}/sql/revoke.sql I am getting [["Revoke

Re: [ansible-project] When var1 == "yes" and var2 == "no"

2020-02-11 Thread Hugo Gonzalez
On 2/11/20 11:44 AM, Jesse Lyon wrote: So, I'm having fits with when conditionals matching strings No matter what I do, it applies each conditional, the combination of the variables doesn't seem to count for ... anything. what the heck am I doing wrong? additionally, is there a better way

Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-10 Thread Hugo Gonzalez
On 2/10/20 3:49 AM, 'deewon' via Ansible Project wrote: Hi all, I'm pretty certain someone has figured this out so any hints will be appreciated I've attached an  azure managed disk to a linux vm  but noticed it doesn't have any disk label  i.e. The disk label is the partition table,