[ansible-project] Re: pywinrm, winrm, ansible - no go

2020-07-10 Thread ameya agashe
You do need an RH subscription if you want to use RHEL, else go for CentOS. On Saturday, 11 July 2020 05:07:12 UTC+10, Eric Holzapfel wrote: > > Hello And Thanks for reply, > > I will try this PIP command (again) but I do not have an RH subscription. > > Also a new symptom, I can run a python

Re: [ansible-project] Using Ansible Collections in molecule test

2020-07-10 Thread Abhijeet Kasurde
Hi, Could you please provide `ansible-galaxy collection list` output? helm_repository is added in Kubernetes collection 0.11.0. If your version Kubernetes collection is less than this then you need to update. On Sat, Jul 11, 2020 at 8:51 AM ksam...@redhat.com wrote: > I am trying to use

[ansible-project] Using Ansible Collections in molecule test

2020-07-10 Thread ksam...@redhat.com
I am trying to use Ansible collections with my molecule test molecule.yml ``` --- dependency: name: galaxy options: requirements-file: molecule/common/requirements.yml driver: name: delegated options: managed: False ansible_connection_options: ansible_connection: local lint: | set -e yamllint .

[ansible-project] Re: pywinrm, winrm, ansible - no go

2020-07-10 Thread Eric Holzapfel
Hello And Thanks for reply, I will try this PIP command (again) but I do not have an RH subscription. Also a new symptom, I can run a python program that imports winrm, but I get an error "no winrm" if I try to run the program as a regular user. If I run it as sudo - the python program runs,

Re: [ansible-project] Need help with registered variable

2020-07-10 Thread Srinivas Naram
Try by removing quotes result[results][0].content.data On Fri, Jul 10, 2020 at 8:04 PM Rahul Kumar wrote: > Thanks Abhijeet ! I tried even result[‘results’][0].content.data but still > it complains results is not dict attribute ! > > On Fri, 10 Jul 2020 at 5:32 PM, Abhijeet Kasurde > wrote:

Re: [ansible-project] Need help with registered variable

2020-07-10 Thread Rahul Kumar
Thanks Abhijeet ! I tried even result[‘results’][0].content.data but still it complains results is not dict attribute ! On Fri, 10 Jul 2020 at 5:32 PM, Abhijeet Kasurde wrote: > 'data' is inside 'content' you might want to check around that > > > On Fri, Jul 10, 2020 at 5:24 PM Rahul Kumar >

[ansible-project] Re: Ansible regex to search and replace an IP Address in a line

2020-07-10 Thread Karn Gusain
I see the attachment is missing for the playbook section hence pasting it here again.. --- - name: Playbook to replace line in zabbix_agentd.conf hosts: all #remote_user: root gather_facts: False tasks: - name: Changing the zabbix-agent configuration on the client lineinfile:

[ansible-project] Ansible regex to search and replace an IP Address in a line

2020-07-10 Thread Karn Gusain
I have an Ansible playbook where I need to change the Server Name in one line and an Specific IP address in another line, as in this line there are a bunch of IP address separated by a comma. I have the below play which works absolutely fine in case I have to change the entire IP address

Re: [ansible-project] Re: Using lineinfile to append items to the END of a line

2020-07-10 Thread Karn Gusain
I have an Ansible playbook where I need to change the Server Name in one line and an Specific IP address in another line, as in this line there are a bunch of IP address separated by a comma. I have the below play which works absolutely fine in case I have to change the entire IP address line

Re: [ansible-project] Re: Using lineinfile to append items to the END of a line

2020-07-10 Thread Karn Gusain
I have an Ansible playbook where I need to change the Server Name in one line and an Specific IP address in another line, as in this line there are a bunch of IP address separated by a comma. I have the below play which works absolutely fine in case I have to change the entire IP address

[ansible-project] jinja2 template error in ansible

2020-07-10 Thread Pradeep Ghorpade
Hello, I am searching which packages are available to install on windows using win_update module. for example I am getting 3 package name. I want print them like below. ServerNamePatch Details serverA 2019-08 Security

Re: [ansible-project] Need help with registered variable

2020-07-10 Thread Abhijeet Kasurde
'data' is inside 'content' you might want to check around that On Fri, Jul 10, 2020 at 5:24 PM Rahul Kumar wrote: > I have a task output like this: > - name: Print Response of status resource > debug: > msg: " {{ result }}" > > ok: [node-3] => { > "msg": " {'msg': u'All items

[ansible-project] Need help with registered variable

2020-07-10 Thread Rahul Kumar
I have a task output like this: - name: Print Response of status resource debug: msg: " {{ result }}" ok: [node-3] => { "msg": " {'msg': u'All items completed', 'changed': False, 'results': [{'ansible_loop_var': u'item', 'failed': False, 'changed': False, u'content': {u'body': None,

Re: [ansible-project] selecting file based on hostname

2020-07-10 Thread Abhijeet Kasurde
This is also possible vars: file_name_mapping: amazon: "sudoers.general" debian: "sudoers.debian" tasks: - debug: msg: "{{ file_name_mapping[ansible_distribution] | default('sudoers.general')}}" On Fri, Jul 10, 2020 at 4:13 PM Abhijeet Kasurde wrote: > Do as the following, which will make

Re: [ansible-project] selecting file based on hostname

2020-07-10 Thread Abhijeet Kasurde
Do as the following, which will make playbook readable file_name: sudoers.general tasks: - name: Set file name when Amazon set_fact: file_name: "sudoers.aspera" when: ansible_distribution == 'amazon' - name: Set file name when Debian set_fact: file_name: "sudoers.debian" when:

[ansible-project] selecting file based on hostname

2020-07-10 Thread Krushna Chandra Sahu
Hi Team, I need a playbook to update the sudoer file based on os distribution. I have written below code but it is failing. - name: Copy sudoers files copy: src: files/{{ file_name }} dest: /etc/sudoers validate: /usr/sbin/visudo -csf %s {% if