[ansible-project] host file doesn't read variable for windows

2020-07-23 Thread Work-Hard
Hello,
my host file for ansible is not reading additional variables. Following is 
my *host file:*
[ubuntu]

[amazonlinux2]

[database]

[windows]

[windows:vars]
ansible_connection = winrm
ansible_ssh_port = 5986
ansible_winrm_transport = kerberos
ansible_winrm_server_cert_validation = ignore
validate_certs = false

*playbook:*
- hosts: windows_server
  vars:
ansible_connection: winrm
ansible_ssh_port: 5986
anisble_winrm_transport: kerberos
ansible_winrm_server_cert_validation: ignore
validate_certs: false
ansible_winrm_scheme: https
ansibe_winrm_read_timeout_sec: 30
ignore_unreachable: true
gather_facts: false



*If I add [windows_server] call it back the playbook, it won't read it for 
some reason and throws out the following error:*
 ESTABLISH WINRM CONNECTION FOR USER: None on PORT 5986 TO 
test.domain.com
fatal: [test.domain.com]: UNREACHABLE! => {
"changed": false,
"msg": "ssl: auth method ssl requires a username",
"unreachable": true


It's using Kerberos authentication where it works for other playbooks. I 
double-checked by entering -klist and ticket are there.

*Any idea why it won't work?*

Thanks,
Jimmy

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/23617350-9b70-4b10-904f-454f7d5ea0abo%40googlegroups.com.


[ansible-project] Re: Which module can I use to run command on command prompt on all my hosts ?

2020-06-01 Thread Work-Hard
Thank you for explaining. It is very helpful!

Cheers,

On Monday, June 1, 2020 at 11:58:15 AM UTC-7, Nick Schendel wrote:
>
> Since you mentioned gpupdate, then I assumed windows.  Ultimately the best 
> place to look to figure out what you can use is to search the all module 
> index:
>
> https://docs.ansible.com/ansible/latest/modules/list_of_all_modules.html
>
> most, if not all of the windows stuff has win_
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a304084-f2ec-43c1-83ab-a8bd0d1e513c%40googlegroups.com.


[ansible-project] Which module can I use to run command on command prompt on all my hosts ?

2020-06-01 Thread Work-Hard
Hi,
Which module can I use as a task to run a command on the command prompt on 
all my hosts?

example - 

cmd: gpupdate/force

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/10b75ea8-b951-4224-bd89-022efe8c78ea%40googlegroups.com.


[ansible-project] Unable to run command on windows. Please explain!

2020-05-29 Thread Work-Hard
Hi, I am unable to run command and throws an error. What am I doing wrong? 
Please explain! Thanks

"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"module_stderr": "Exception calling \"Create\" with \"1\" argument(s): 
\"At line:4 char:21\r\n+ def _ansiballz_main():\r\n+
 ~\r\nAn expression was expected after '('.\r\nAt line:13 char:27\r\n+
 except (AttributeError, OSError):\r\n+  
 ~\r\nMissing argument in parameter list.\r\nAt line:15 char:7\r\n+ if 
scriptdir is not None:\r\n+   ~\r\nMissing '(' after 'if' in if 
statement.\r\nAt line:22 char:7\r\n+ if sys.version_info < (3,):\r\n+  
 ~\r\nMissing '(' after 'if' in if statement.\r\nAt line:22 
char:30\r\n+ if sys.version_info < (3,):\r\n+  
~\r\nMissing expression after ','.\r\nAt line:22 char:25\r\n+ if 
sys.version_info < (3,):\r\n+ ~\r\nThe '<' operator 
is reserved for future use.\r\nAt line:27 char:34\r\n+ def 
invoke_module(modlib_path, temp_path, json_params):\r\n+
  ~\r\nMissing argument in parameter list.\r\nAt line:28 
char:40\r\n+ z = zipfile.ZipFile(modlib_path, mode='a')\r\n+
~\r\nMissing argument in parameter 
list.\r\nAt line:31 char:33\r\n+ zinfo = zipfile.ZipInfo()\r\n+
 ~\r\nAn expression was expected after 
'('.\r\nAt line:34 char:25\r\n+ z.writestr(zinfo, 
sitecustomize)\r\n+ ~\r\nMissing argument in 
parameter list.\r\nNot all parse errors were reported.  Correct the 
reported errors and try again.\"\r\nAt line:6 char:1\r\n+ $exec_wrapper = 
[ScriptBlock]::Create($split_parts[0])\r\n+ 
~~\r\n+ 
CategoryInfo  : NotSpecified: (:) [], 
MethodInvocationException\r\n+ FullyQualifiedErrorId : 
ParseException\r\n \r\nThe expression after '&' in a pipeline element 
produced an object that was not valid. It must result in a command 
\r\nname, a script block, or a CommandInfo object.\r\nAt line:7 char:2\r\n+ 
&$exec_wrapper\r\n+  ~\r\n+ CategoryInfo  : 
InvalidOperation: (:) [], RuntimeException\r\n+ FullyQualifiedErrorId : 
BadExpression\r\n ",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}

task:
- hosts: windows
  vars:
ansible_connection: winrm
ansible_ssh_port: 5986
anisble_winrm_transport: kerberos
ansible_winrm_server_cert_validation: ignore
validate_certs: false
ansible_winrm_scheme: https
ansibe_winrm_read_timeout_sec: 30
ignore_unreachable: true
gather_facts: false
  tasks:
  - name: Updating intial GPO's
command:
   cmd: gpupdate/force

  - name: Reboot the workstation for first intiation
command:
  cmd: shutdown/r
  pause:
minutes: 1

  - name: Ensure WinRM starts when the system has settled and is ready to 
work reliably
win_service:
  name: WinRM
  start_mode: delayed

  - name: Ensure we wait long enough for the updates to be applied during 
reboot
win_updates:
  reboot: yes
  reboot_timeout: 3600
  ignore_errors: yes

  - name: Updating GPO's
command:
  cmd: gpupdate/force

  - name: Reboot the workstation
command:
  cmd: shutdown/r
  pause:
minutes: 1

  - name: Ensure WinRM starts when the system has settled and is ready to 
work reliably
win_service:
  name: WinRM
  start_mode: delayed

  - name: Ensure we wait long enough for the updates to be applied during 
reboot
win_updates:
  reboot: yes
  reboot_timeout: 3600
  ignore_errors: yes


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d3ac2729-3f78-49f5-a834-1b40e1de81a6%40googlegroups.com.


Re: [ansible-project] If unreachable - stop giving Failed out and move to next host

2020-05-11 Thread Work-Hard
Hi Dick, 
The script from the article reports a 404 error for Ec2 external inventory 
script. Do you have it handy ?

https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html#inventory-script-example-aws-ec2


On Friday, May 8, 2020 at 8:50:03 PM UTC-7, Dick Visser wrote:
>
> This is exactly what the dynamic inventory is meant for. Basically if 
> queries the aws api to fetch a list of the instances that are up, and 
> provides that as the inventory. 
>
>
> https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html#inventory-script-example-aws-ec2
>
>
>
> On Fri, 8 May 2020 at 23:09, Work-Hard > 
> wrote:
>
>> Hi Dick,
>> I just to make sure on your suggestion that I have over 100 hosts that 
>> brought up and down dynamically. My goal is that the tasks should stop 
>> reporting HUGE errors in the output and we save them to be reviewed by 
>> external companies. Is it possible ?
>>
>> On Friday, May 8, 2020 at 11:16:31 AM UTC-7, Dick Visser wrote:
>>>
>>> You could use the ec2.py dynamic inventory to at least target the 
>>> instances that are powered on. It's more elegant than ignoring errors etc 
>>>
>>> On Fri, 8 May 2020 at 17:45, Work-Hard  wrote:
>>>
>>>> Brian if I remove ignore_unreachable=true. The playbook halts to 
>>>> continue the playbook.
>>>>
>>>>
>>>>
>>>>
>>>> On Friday, May 8, 2020 at 7:47:19 AM UTC-7, Brian Coca wrote:
>>>>>
>>>>> if you want to stop that ... dont use ignore_unreachable=true, the 
>>>>> 'default' behaviour is to remove the host from play and not try 
>>>>> executing subsequent tasks (that of course fail again). 
>>>>>
>>>>>
>>>>> -- 
>>>>> -- 
>>>>> Brian Coca 
>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Ansible Project" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to ansible...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/ansible-project/cabf81b2-0451-417e-b108-df53a91f3dff%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/ansible-project/cabf81b2-0451-417e-b108-df53a91f3dff%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>>> Sent from a mobile device - please excuse the brevity, spelling and 
>>> punctuation.
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/89732f66-d11f-4dab-86b4-c560e035c52a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/89732f66-d11f-4dab-86b4-c560e035c52a%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d0db9791-7508-4195-a85b-8f36fbf2b2be%40googlegroups.com.


Re: [ansible-project] If unreachable - stop giving Failed out and move to next host

2020-05-08 Thread Work-Hard
Hi Dick,
I just to make sure on your suggestion that I have over 100 hosts that 
brought up and down dynamically. My goal is that the tasks should stop 
reporting HUGE errors in the output and we save them to be reviewed by 
external companies. Is it possible ?

On Friday, May 8, 2020 at 11:16:31 AM UTC-7, Dick Visser wrote:
>
> You could use the ec2.py dynamic inventory to at least target the 
> instances that are powered on. It's more elegant than ignoring errors etc 
>
> On Fri, 8 May 2020 at 17:45, Work-Hard > 
> wrote:
>
>> Brian if I remove ignore_unreachable=true. The playbook halts to continue 
>> the playbook.
>>
>>
>>
>>
>> On Friday, May 8, 2020 at 7:47:19 AM UTC-7, Brian Coca wrote:
>>>
>>> if you want to stop that ... dont use ignore_unreachable=true, the 
>>> 'default' behaviour is to remove the host from play and not try 
>>> executing subsequent tasks (that of course fail again). 
>>>
>>>
>>> -- 
>>> -- 
>>> Brian Coca 
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/cabf81b2-0451-417e-b108-df53a91f3dff%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/cabf81b2-0451-417e-b108-df53a91f3dff%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/89732f66-d11f-4dab-86b4-c560e035c52a%40googlegroups.com.


Re: [ansible-project] If unreachable - stop giving Failed out and move to next host

2020-05-08 Thread Work-Hard
Brian if I remove ignore_unreachable=true. The playbook halts to continue 
the playbook.




On Friday, May 8, 2020 at 7:47:19 AM UTC-7, Brian Coca wrote:
>
> if you want to stop that ... dont use ignore_unreachable=true, the 
> 'default' behaviour is to remove the host from play and not try 
> executing subsequent tasks (that of course fail again). 
>
>
> -- 
> -- 
> Brian Coca 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cabf81b2-0451-417e-b108-df53a91f3dff%40googlegroups.com.


Re: [ansible-project] If unreachable - stop giving Failed out and move to next host

2020-05-08 Thread Work-Hard
They are either off or unreachable over VPN. This is from production.

On Thursday, May 7, 2020 at 3:28:33 PM UTC-7, Dick Visser wrote:
>
> Out of interest - what is the reason they are unreachable? 
>
> On Fri, 8 May 2020 at 00:17, Work-Hard > 
> wrote: 
> > 
> > Hi, 
> > Is it possible for the host that if it's unreachable - stop giving 
> Failed output and move to the next task. As of now, it just shows the 
> output fails. 
> > 
> > 
> > --- 
> > - hosts: amazonlinux2 
> >   become: true 
> >   serial: 1 
> >   max_fail_percentage: 0 
> >   ignore_errors: true 
> >   gather_facts: false 
> >   ignore_unreachable: true 
> >   vars: 
> > ansible_user: ec2-user 
> >   ignore_errors: yes 
> > 
> > 
> > Output - 
> > 
> > fatal: [10.0.2.6]: FAILED! => {"changed": true, "changes": {"installed": 
> [], "updated": [["kernel", "4.14.177-139.253.amzn2.x86_64 from 
> amzn2-core"], ["libwayland-server", "1.17.0-1.amzn2.x86_64 from 
> amzn2-core"], ["http-parser", "2.7.1-8.amzn2.2.x86_64 from amzn2-core"], 
> ["libglvnd-glx", "1:1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 from 
> amzn2-core"], ["python2-rsa", "3.4.1-1.el7.noarch from epel"], ["librsvg2", 
> "2.40.20-1.amzn2.x86_64 from amzn2-core"], ["cairo", 
> "1.15.12-4.amzn2.x86_64 from amzn2-core"], ["libX11", "1.6.7-2.amzn2.x86_64 
> from amzn2-core"], ["harfbuzz", "1.7.5-2.amzn2.x86_64 from amzn2-core"], 
> ["libXrandr", "1.5.1-2.amzn2.0.3.x86_64 from amzn2-core"], ["htop", 
> "2.2.0-3.el7.x86_64 from epel"], ["gdisk", "0.8.10-3.amzn2.x86_64 from 
> amzn2-core"], ["perl-Git", "2.23.3-1.amzn2.0.1.noarch from amzn2-core"], 
> ["mesa-libgbm", "18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], ["libicu", 
> "50.2-4.amzn2.x86_64 from amzn2-core"], ["git", "2.23.3-1.amzn2.0.1.x86_64 
> from amzn2-core"], ["nagios-common", "4.4.5-7.el7.x86_64 from epel"], 
> ["libglvnd", "1:1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 from amzn2-core"], 
> ["python-colorama", "0.3.2-3.el7.noarch from epel"], ["fontconfig", 
> "2.13.0-4.3.amzn2.x86_64 from amzn2-core"], ["microcode_ctl", 
> "2:2.1-47.amzn2.0.6.x86_64 from amzn2-core"], ["pystache", 
> "0.5.3-2.el7.noarch from epel"], ["python2-jsonschema", "2.5.1-4.el7.noarch 
> from epel"], ["sscg", "2.6.1-1.el7.x86_64 from epel"], ["git-core", 
> "2.23.3-1.amzn2.0.1.x86_64 from amzn2-core"], ["python-pillow", 
> "2.0.0-20.gitd1c6db8.amzn2.0.1.x86_64 from amzn2-core"], 
> ["gtk-update-icon-cache", "3.22.30-3.amzn2.x86_64 from amzn2-core"], 
> ["freetype", "2.8-14.amzn2.x86_64 from amzn2-core"], ["avahi-libs", 
> "0.6.31-19.amzn2.0.1.x86_64 from amzn2-core"], ["gdk-pixbuf2", 
> "2.36.12-3.amzn2.x86_64 from amzn2-core"], ["python2-jmespath", 
> "0.9.4-1.el7.noarch from epel"], ["nagios-plugins-nrpe", 
> "4.0.2-1.el7.x86_64 from epel"], ["telnet", "1:0.17-65.amzn2.x86_64 from 
> amzn2-core"], ["libglvnd-egl", "1:1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 
> from amzn2-core"], ["libidn2", "2.3.0-1.el7.x86_64 from epel"], ["libdrm", 
> "2.4.97-2.amzn2.x86_64 from amzn2-core"], ["mesa-libEGL", 
> "18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], ["python2-futures", 
> "3.0.5-1.el7.noarch from epel"], ["libwayland-client", 
> "1.17.0-1.amzn2.x86_64 from amzn2-core"], ["mesa-libGL", 
> "18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], ["libX11-common", 
> "1.6.7-2.amzn2.noarch from amzn2-core"], ["pango", "1.42.4-4.amzn2.x86_64 
> from amzn2-core"], ["kernel-tools", "4.14.177-139.253.amzn2.x86_64 from 
> amzn2-core"], ["kernel-headers", "4.14.177-139.253.amzn2.x86_64 from 
> amzn2-core"], ["pgdg-redhat-repo", "42.0-6.noarch from pgdg94"], 
> ["fribidi", "1.0.2-1.amzn2.1.x86_64 from amzn2-core"], ["nrpe", 
> "4.0.2-1.el7.x86_64 from epel"], ["python-jinja2", "2.8-7.rhel7.noarch from 
> pgdg94"], [&qu

[ansible-project] If unreachable - stop giving Failed out and move to next host

2020-05-07 Thread Work-Hard
Hi,
Is it possible for the host that if it's unreachable - stop giving Failed 
output and move to the next task. As of now, it just shows the output 
fails. 


---
- hosts: amazonlinux2
  become: true
  serial: 1
  max_fail_percentage: 0
  ignore_errors: true
  gather_facts: false
  ignore_unreachable: true
  vars:
ansible_user: ec2-user
  ignore_errors: yes


Output - 

fatal: [10.0.2.6]: FAILED! => {"changed": true, "changes": {"installed": 
[], "updated": [["kernel", "4.14.177-139.253.amzn2.x86_64 from 
amzn2-core"], ["libwayland-server", "1.17.0-1.amzn2.x86_64 from 
amzn2-core"], ["http-parser", "2.7.1-8.amzn2.2.x86_64 from amzn2-core"], 
["libglvnd-glx", "1:1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 from 
amzn2-core"], ["python2-rsa", "3.4.1-1.el7.noarch from epel"], ["librsvg2", 
"2.40.20-1.amzn2.x86_64 from amzn2-core"], ["cairo", 
"1.15.12-4.amzn2.x86_64 from amzn2-core"], ["libX11", "1.6.7-2.amzn2.x86_64 
from amzn2-core"], ["harfbuzz", "1.7.5-2.amzn2.x86_64 from amzn2-core"], 
["libXrandr", "1.5.1-2.amzn2.0.3.x86_64 from amzn2-core"], ["htop", 
"2.2.0-3.el7.x86_64 from epel"], ["gdisk", "0.8.10-3.amzn2.x86_64 from 
amzn2-core"], ["perl-Git", "2.23.3-1.amzn2.0.1.noarch from amzn2-core"], 
["mesa-libgbm", "18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], ["libicu", 
"50.2-4.amzn2.x86_64 from amzn2-core"], ["git", "2.23.3-1.amzn2.0.1.x86_64 
from amzn2-core"], ["nagios-common", "4.4.5-7.el7.x86_64 from epel"], 
["libglvnd", "1:1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 from amzn2-core"], 
["python-colorama", "0.3.2-3.el7.noarch from epel"], ["fontconfig", 
"2.13.0-4.3.amzn2.x86_64 from amzn2-core"], ["microcode_ctl", 
"2:2.1-47.amzn2.0.6.x86_64 from amzn2-core"], ["pystache", 
"0.5.3-2.el7.noarch from epel"], ["python2-jsonschema", "2.5.1-4.el7.noarch 
from epel"], ["sscg", "2.6.1-1.el7.x86_64 from epel"], ["git-core", 
"2.23.3-1.amzn2.0.1.x86_64 from amzn2-core"], ["python-pillow", 
"2.0.0-20.gitd1c6db8.amzn2.0.1.x86_64 from amzn2-core"], 
["gtk-update-icon-cache", "3.22.30-3.amzn2.x86_64 from amzn2-core"], 
["freetype", "2.8-14.amzn2.x86_64 from amzn2-core"], ["avahi-libs", 
"0.6.31-19.amzn2.0.1.x86_64 from amzn2-core"], ["gdk-pixbuf2", 
"2.36.12-3.amzn2.x86_64 from amzn2-core"], ["python2-jmespath", 
"0.9.4-1.el7.noarch from epel"], ["nagios-plugins-nrpe", 
"4.0.2-1.el7.x86_64 from epel"], ["telnet", "1:0.17-65.amzn2.x86_64 from 
amzn2-core"], ["libglvnd-egl", "1:1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 
from amzn2-core"], ["libidn2", "2.3.0-1.el7.x86_64 from epel"], ["libdrm", 
"2.4.97-2.amzn2.x86_64 from amzn2-core"], ["mesa-libEGL", 
"18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], ["python2-futures", 
"3.0.5-1.el7.noarch from epel"], ["libwayland-client", 
"1.17.0-1.amzn2.x86_64 from amzn2-core"], ["mesa-libGL", 
"18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], ["libX11-common", 
"1.6.7-2.amzn2.noarch from amzn2-core"], ["pango", "1.42.4-4.amzn2.x86_64 
from amzn2-core"], ["kernel-tools", "4.14.177-139.253.amzn2.x86_64 from 
amzn2-core"], ["kernel-headers", "4.14.177-139.253.amzn2.x86_64 from 
amzn2-core"], ["pgdg-redhat-repo", "42.0-6.noarch from pgdg94"], 
["fribidi", "1.0.2-1.amzn2.1.x86_64 from amzn2-core"], ["nrpe", 
"4.0.2-1.el7.x86_64 from epel"], ["python-jinja2", "2.8-7.rhel7.noarch from 
pgdg94"], ["mesa-libglapi", "18.3.4-5.amzn2.0.1.x86_64 from amzn2-core"], 
["python-repoze-lru", "0.4-3.el7.noarch from epel"], ["nagios-plugins", 
"2.3.3-2.el7.x86_64 from epel"], ["git-core-doc", 
"2.23.3-1.amzn2.0.1.noarch from amzn2-core"], ["python-lockfile", 
"1:0.9.1-4.el7.noarch from epel"], ["yum", "3.4.3-158.amzn2.0.4.noarch from 
amzn2-core"], ["python-daemon", "1.6-4.el7.noarch from epel"], ["glib2", 
"2.56.1-5.amzn2.0.1.x86_64 from amzn2-core"], ["php55-php-pear", 
"1:1.10.12-1.el7.remi.noarch from remi-safe"], ["awscli", 
"1.16.300-1.amzn2.0.2.noarch from amzn2-core"], ["libmetalink", 
"0.1.3-1.el7.x86_64 from epel"]]}, "msg": "Error: Package: 
pgdg-redhat-repo-42.0-6.noarch (pgdg94)\n   Requires: 
/etc/redhat-release\n", "obsoletes": {"pgdg-centos94": {"dist": "noarch", 
"repo": "installed", "version": "9.4-3"}}, "rc": 1, "results": ["Loaded 
plugins: langpacks, update-motd\nResolving Dependencies\n--> Running 
transaction check\n---> Package avahi-libs.x86_64 0:0.6.31-19.amzn2 will be 
updated\n---> Package avahi-libs.x86_64 0:0.6.31-19.amzn2.0.1 will be an 
update\n---> Package awscli.noarch 0:1.16.300-1.amzn2.0.1 will be 
updated\n---> Package awscli.noarch 0:1.16.300-1.amzn2.0.2 will be an 
update\n---> Package cairo.x86_64 0:1.14.8-2.amzn2.0.2 will be 
updated\n---> Package cairo.x86_64 0:1.15.12-4.amzn2 will be an 
update\n---> Package fontconfig.x86_64 0:2.10.95-11.amzn2.0.2 will be 
updated\n---> Package fontconfig.x86_64 0:2.13.0-4.3.amzn2 will be an 
update\n--> Processing Dependency: dejavu-sans-fonts for package: 
fontconfig-2.13.0-4.3.amzn2.x86_64\n---> Package freetype.x86_64 
0:2.4.11-15.amzn2.0.2 will be updated\n---> Package freetype.x86_64 
0:2.8-14.amzn2 will be an 

[ansible-project] Re: Target machines are unreachable

2020-05-05 Thread Work-Hard
 FAILED! => {"changed": false, "cmd": ["dpkg", "--configure", "a"], 
"delta": "0:00:00.064010", "end": "2020-05-06 01:18:35.173136", "msg": 
"non-zero return code", "rc": 1, "start": "2020-05-06 01:18:35.109126", 
"stderr": "dpkg: error processing package a (--configure):\n no package 
named 'a' is installed, cannot configure\nErrors were encountered while 
processing:\n a", "stderr_lines": ["dpkg: error processing package a 
(--configure):", " no package named 'a' is installed, cannot configure", 
"Errors were encountered while processing:", " a"], "stdout": "", 
"stdout_lines": []}

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e3c4b33b-88f0-4c24-bc51-71b81583ff1b%40googlegroups.com.


[ansible-project] Target machines are unreachable

2020-05-05 Thread Work-Hard
my target machines are up. I don't understand why I am running this error


Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: None on PORT 5986 TO 
fatal: []: UNREACHABLE! => {
"changed": false,
"msg": "ssl: auth method ssl requires a username",
"unreachable": true
}

Can someone please explain? Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/afe6aa15-5023-4b89-8a99-eabbf9d1cb57%40googlegroups.com.


[ansible-project] Is there a way we can delay the connection instead of unreachable

2020-04-05 Thread Work-Hard
Hello,

ISSUE -  Whenever a user in a company is not connected to the vpn; ansible 
fails the connection (as unreachable). Is there a way we can delay the 
connection for 20 days and have it keep trying every hour, instead of 
showing "unreachable"?

REASON-  I need the output to look clean when I save the file in order to 
validate within the company.

I appreciate your help!

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/87962a47-dcc9-4b81-8600-c54be1285fec%40googlegroups.com.


[ansible-project] Is there Module to output the playbook in specific directory for windows and linux hosts ?

2020-02-28 Thread Work-Hard
hello,
Is there a Module to output the playbook in a specific directory for 
windows and Linux hosts? say -  I want to output the result of the playbook 
in /etc/ansible/win-logs for windows and /etc/ansible/Linux-logs

thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/828e2c81-a289-4c3f-a723-b5dca1942d97%40googlegroups.com.


[ansible-project] Re: Docker container is not starting on ubuntu 18.0 ver for ansible. Any idea?

2020-02-14 Thread Work-Hard
I was able to figure it ou "docker wasn't starting"
systemctl start docker helped - if you're curious

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1cca5daf-3bf6-4546-8487-b3a43fa2998e%40googlegroups.com.


[ansible-project] Re: Docker container is not starting on ubuntu 18.0 ver for ansible. Any idea?

2020-02-14 Thread Work-Hard
this is a separate issue (Dick). it seems like when I upgraded to 18 from 
16 ubuntu version. it broke and gave me the reporting error. Also, I 
deployed a new server from scratch with no issues. 


Any insights will help!
>
>
thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3e55254d-ecdd-4508-a094-dc976de781d4%40googlegroups.com.


Re: [ansible-project] timout-playbook for ubuntu after reboot

2020-02-14 Thread Work-Hard
thanks dick for replying. I was able to figure it out the issue. I had to 
"register" to keep it going. 

On Friday, February 14, 2020 at 9:23:14 AM UTC-8, Dick Visser wrote:
>
> Hi 
>
> The reboot module was created to avoid manual fiddling with shell cruft 
> like you do now. So what’s the reason you are not using the reboot module?
> If possible please reply to this thread and don’t start yet another one.
>
> Thx!
>
>
> On Thu, 13 Feb 2020 at 20:55, Work-Hard  > wrote:
>
>> *Hi, can someone please explain why my playbook for instance timeout 
>> after a reboot:*
>> /dev/null 2>&1 && sleep 0'
>> The full traceback is:
>> WARNING: The below traceback may *not* be related to the actual failure.
>>   File 
>> "/tmp/ansible_wait_for_payload_NqkPb5/ansible_wait_for_payload.zip/ansible/modules/utilities/logic/wait_for.py",
>>  
>> line 599, in main
>>   File 
>> "/tmp/ansible_wait_for_payload_NqkPb5/ansible_wait_for_payload.zip/ansible/modules/utilities/logic/wait_for.py",
>>  
>> line 456, in _create_connection
>>   File "/usr/lib/python2.7/socket.py", line 557, in create_connection
>> for res in getaddrinfo(host, port, 0, SOCK_STREAM):
>>
>> fatal: [10.0.2.236 -> localhost]: FAILED! => {
>> "changed": false,
>> "elapsed": 600,
>> "invocation": {
>> "module_args": {
>> "active_connection_states": [
>> "ESTABLISHED",
>> "FIN_WAIT1",
>> "FIN_WAIT2",
>> "SYN_RECV",
>> "SYN_SENT",
>> "TIME_WAIT"
>> ],
>> "connect_timeout": 5,
>> "delay": 5,
>> "exclude_hosts": null,
>> "host": "ubuntu",
>> "msg": null,
>> "path": null,
>> "port": 22,
>> "search_regex": null,
>> "sleep": 1,
>> "state": "started",
>> "timeout": 600
>> }
>> },
>> "msg": "Timeout when waiting for ubuntu:22"
>> }
>>
>>
>>
>> playbook : 
>>
>> - name: reboot node
>>   shell: sleep 2 && shutdown -r now "Reboot triggered by ansible"
>>   async: 1
>>   poll: 0
>>   ignore_errors: true
>>
>> # poll ssh port until we get a tcp connect
>> - name: wait for node to finish booting
>>   become: false
>>   local_action: wait_for host=ubuntu
>>   port=22
>>   state=started
>>   delay=5
>>   timeout=600
>> *--(timeout after this)--FYI: instance was 
>> rebooted within 60 secs*
>> # give sshd time to start fully
>> - name: wait for ssh to start fully
>>   pause:
>> seconds: 15
>>
>> # wait a few minutes between hosts, unless we're on the last
>> - name: waiting between hosts
>>   pause:
>> minutes: 10
>>   when: inventory_hostname != ansible_play_hosts[-1]
>>
>> *Please explain thanks*
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/72837911-8769-4ace-8f7f-ae20082a66a4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/72837911-8769-4ace-8f7f-ae20082a66a4%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/71888e6e-4793-4fa6-99d9-0c11b5f67bdf%40googlegroups.com.


[ansible-project] Docker container is not starting on ubuntu 18.0 ver for ansible. Any idea?

2020-02-13 Thread Work-Hard
Docker container is not starting on ubuntu 18.0 ver for ansible. *Any idea?*
*TASK [local_docker : Start the containers] 

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error connecting: 
Error while fetching server API version: *('Connection aborted.', 
error(111, 'Connection refused'))"}*
tion aborted.', error(111, 'Connection refused'))"}

I used this article for reference - 
https://computingforgeeks.com/how-to-install-ansible-awx-on-ubuntu-linux/

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/656f29b7-88e8-433f-84b9-7b857b93d330%40googlegroups.com.


[ansible-project] timout-playbook for ubuntu after reboot

2020-02-13 Thread Work-Hard
*Hi, can someone please explain why my playbook for instance timeout after 
a reboot:*
/dev/null 2>&1 && sleep 0'
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File 
"/tmp/ansible_wait_for_payload_NqkPb5/ansible_wait_for_payload.zip/ansible/modules/utilities/logic/wait_for.py",
 
line 599, in main
  File 
"/tmp/ansible_wait_for_payload_NqkPb5/ansible_wait_for_payload.zip/ansible/modules/utilities/logic/wait_for.py",
 
line 456, in _create_connection
  File "/usr/lib/python2.7/socket.py", line 557, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):

fatal: [10.0.2.236 -> localhost]: FAILED! => {
"changed": false,
"elapsed": 600,
"invocation": {
"module_args": {
"active_connection_states": [
"ESTABLISHED",
"FIN_WAIT1",
"FIN_WAIT2",
"SYN_RECV",
"SYN_SENT",
"TIME_WAIT"
],
"connect_timeout": 5,
"delay": 5,
"exclude_hosts": null,
"host": "ubuntu",
"msg": null,
"path": null,
"port": 22,
"search_regex": null,
"sleep": 1,
"state": "started",
"timeout": 600
}
},
"msg": "Timeout when waiting for ubuntu:22"
}



playbook : 

- name: reboot node
  shell: sleep 2 && shutdown -r now "Reboot triggered by ansible"
  async: 1
  poll: 0
  ignore_errors: true

# poll ssh port until we get a tcp connect
- name: wait for node to finish booting
  become: false
  local_action: wait_for host=ubuntu
  port=22
  state=started
  delay=5
  timeout=600
*--(timeout after this)--FYI: instance was rebooted 
within 60 secs*
# give sshd time to start fully
- name: wait for ssh to start fully
  pause:
seconds: 15

# wait a few minutes between hosts, unless we're on the last
- name: waiting between hosts
  pause:
minutes: 10
  when: inventory_hostname != ansible_play_hosts[-1]

*Please explain thanks*


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/72837911-8769-4ace-8f7f-ae20082a66a4%40googlegroups.com.


[ansible-project] Playbook doesn't run completely stuck after "check if reboot required"

2020-02-12 Thread Work-Hard
*Playbook doesn't run completely stuck after "check if reboot required". 
Please assist!*

*Play-Book*
---
- hosts: ubuntu
  become: true
  any_errors_fatal: true
  serial: 1
  max_fail_percentage: 0
  vars:
ansible_user: ubuntu
  tasks:
# do an "apt-get update", to ensure latest package lists
- name: apt-get update
  apt:
update-cache: yes
  changed_when: 0

# get a list of packages that have updates
- name: get list of pending upgrades
  command: apt-get --simulate dist-upgrade
  args:
warn: false # don't warn us about apt having its own plugin
  register: apt_simulate
  changed_when: 0

- name: Update cache
  apt:
update-cache: yes
  changed_when: false

- name: Fetch package list of updates
  command: apt list --upgradable
  register: aptlist
- set_fact:
updates: "{{ aptlist.stdout_lines | difference(['Listing...'])
| map('regex_replace', '^(.*?)/(.*)', '\\1') | list }}"

- debug: var=updates

# tell user about packages being updated
- name: show pending updates
  debug:
var: updates
  when: updates.0 is defined

# running package ack each server update with a prompt
- pause:
  when: updates.0 is defined

# if a new kernel is incoming, remove old ones to avoid full /boot
- name: apt-get autoremove
  command: apt-get -y autoremove
  args:
warn: false
  when: '"Inst linux-image-" in apt_simulate.stdout'
  changed_when: 0

# do the actual apt-get dist-upgrade
- name: apt-get dist-upgrade
  apt:
upgrade: dist # upgrade all packages to latest version
  register: upgrade_output

# check if we need a reboot
- name: check if reboot needed
  stat: path=/var/run/reboot-required
  register: file_reboot_required

# "meta: end_play" aborts the rest of the tasks in the current «tasks:»
# section, for the current desired server
- meta: end_play
  when: not file_reboot_required.stat.exists

# because of the above meta/when we at this point know that the current
# host needs a reboot

# prompt for manual input before doing the actual reboot
- name: Confirm reboot of ubuntu
  pause:

- name: reboot node
  shell: sleep 2 && shutdown -r now "Reboot triggered by ansible"
  async: 1
  poll: 0
  ignore_errors: true

# poll ssh port until we get a tcp connect
- name: wait for node to finish booting
  become: false
  local_action: wait_for host=ubuntu
  port=22
  state=started
  delay=5
  timeout=600

# give sshd time to start fully
- name: wait for ssh to start fully
  pause:
seconds: 15

# wait a few minutes between hosts, unless we're on the last
- name: waiting between hosts
  pause:
minutes: 10
  when: inventory_hostname != ansible_play_hosts[-1]

*Output*
PLAY [ubuntu] 


TASK [Gathering Facts] 
***
ok: [10.0.2.236]

TASK [apt-get update] 

ok: [10.0.2.236]

TASK [get list of pending upgrades] 
**
ok: [10.0.2.236]

TASK [Update cache] 
**
ok: [10.0.2.236]

TASK [Fetch package list of updates] 
*
changed: [10.0.2.236]

TASK [set_fact] 
**
ok: [10.0.2.236]

TASK [debug] 
*
ok: [10.0.2.236] => {
"updates": []
}

TASK [show pending updates] 
**
skipping: [10.0.2.236]

TASK [pause] 
*
skipping: [10.0.2.236]

TASK [apt-get autoremove] 

skipping: [10.0.2.236]

TASK [apt-get dist-upgrade] 

[ansible-project] Re: how can i have my windows instances to use IP address instead of dns name?

2020-02-11 Thread Work-Hard
okay thank you

On Monday, February 10, 2020 at 6:26:03 PM UTC-8, Jordan Borean wrote:
>
> Just set the connection to use IPs as you would Linux it should just work. 
> Without seeing the error that you are receiving we can't help you anymore. 
> The most common reason why it doesn't is if you are using Kerberos auth. 
> This is because DNS is a very important part of Kerberos auth and using IPs 
> removes some of protection kerberos offers. It is still possible but I 
> wouldn't recommend it at all.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9d322bb0-2643-4756-af61-1d3d346f3fca%40googlegroups.com.


[ansible-project] how can i have my windows instances to use IP address instead of dns name?

2020-02-10 Thread Work-Hard
Hello,
how can i have my windows instances to use IP address instead of dns name? 
it works with my Linux instances but windows.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6885c38c-b75d-4ddb-a295-c8805a711212%40googlegroups.com.


Re: [ansible-project] Re: Switch to root user using dzdo

2020-02-07 Thread Work-Hard
oh yea? how's that? Please do explain!

On Friday, February 7, 2020 at 12:48:39 PM UTC-8, Dick Visser wrote:
>
> On Fri, 7 Feb 2020 at 21:17, Work-Hard > 
> wrote: 
> > 
> > as a workaround, you can change the file permission on linux to act as 
> root for your target area. 
>
> That sounds like throwing all security out of the window. 
> Please refrain from giving this kind of useless advice... 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/12767763-0225-48d0-be22-27cee4eb6ff6%40googlegroups.com.


[ansible-project] Re: Switch to root user using dzdo

2020-02-07 Thread Work-Hard
as a workaround, you can change the file permission on linux to act as root 
for your target area.

On Friday, February 7, 2020 at 2:45:02 AM UTC-8, Poemy wrote:
>
> I have an ansible playblook running some tasks for my user, which I log in 
> through ssh.
>
> The user has root privileges by running following command in the terminal:
> dzdo su -
>
> It's actually the only way (no sudo, no root password) to get root access.
>
> Now, what I want to do is to switch my user to root at a certain point in 
> my ansible-playbook, using this *dzdo su -* behavior. 
>
> How to do this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/032c5586-2d91-4e57-8d15-9db8b4e83540%40googlegroups.com.


[ansible-project] Re: Anible windows script get stuck for my of my machine - Although reboot command is provided to reboot if required. any idea, why ?

2020-02-07 Thread Work-Hard
It's been a day by playbook is stuck. so stopped it and ran -vvv. it's 
showing the following* Output in a LOOP*. I am not sure why is stuck
EXEC (via pipeline wrapper)
win_updates: check win_updates results for automatic reboot: 
{"_ansible_parsed": true, "filtered_updates": 
{"90f5678b-7d52-4e49-9774-672f2195a924": {"kb": ["2760587"], "title": 
"Definition Update for Microsoft Office 2013 (KB2760587) 64-Bit Edition", 
"filtered_reason": "category_names", "installed": false, "id": 
"90f5678b-7d52-4e49-9774-672f2195a924", "categories": ["Definition 
Updates", "Office 2013"]}, "d0478bde-b17d-4cd7-9cbc-939c62b62c96": {"kb": 
["2850036"], "title": "Service Pack 1 for Microsoft Office 2013 (KB2850036) 
64-Bit Edition", "filtered_reason": "category_names", "installed": false, 
"id": "d0478bde-b17d-4cd7-9cbc-939c62b62c96", "categories": ["Office 2013", 
"Service Packs"]}, "90c89d3a-eca2-429f-954f-60e13ae8d0a6": {"kb": 
["4534132"], "title": "2020-01 Cumulative Update for .NET Framework 3.5 and 
4.8 for Windows 10 Version 1909 for x64 (KB4534132)", "filtered_reason": 
"category_names", "installed": false, "id": 
"90c89d3a-eca2-429f-954f-60e13ae8d0a6", "categories": ["Updates", "Windows 
10, version 1903 and later"]}, "99048d16-6599-4702-b9db-25301118dc19": 
{"kb": ["3115404"], "title": "Definition Update for Microsoft Office 2013 
(KB3115404) 64-Bit Edition", "filtered_reason": "category_names", 
"installed": false, "id": "99048d16-6599-4702-b9db-25301118dc19", 
"categories": ["Definition Updates", "Office 2013"]}}, 
"installed_update_count": 24, "changed": false, "reboot_required": false, 
"failed_update_count": 0, "updates": 
{"7fe77a25-b7db-4eda-b88d-1413a7220b2c": {"kb": ["2863843"], "installed": 
true, "id": "7fe77a25-b7db-4eda-b88d-1413a7220b2c", "categories": 
["Critical Updates", "Office 2013"], "title": "Update for Microsoft Office 
2013 (KB2863843) 64-Bit Edition"}, "82ee9a22-750a-45db-9e9c-0ab04bbdc719": 
{"kb": ["2883095"], "installed": true, "id": 
"82ee9a22-750a-45db-9e9c-0ab04bbdc719", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2883095) 
64-Bit Edition"}, "eb7fa6ce-1179-40a1-aacd-6e0cf16648c5": {"kb": 
["2837652"], "installed": true, "id": 
"eb7fa6ce-1179-40a1-aacd-6e0cf16648c5", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft SkyDrive Pro (KB2837652) 
64-Bit Edition"}, "6d1e3c9a-29cd-425c-a0fa-913d8c284d8b": {"kb": 
["2899522"], "installed": true, "id": 
"6d1e3c9a-29cd-425c-a0fa-913d8c284d8b", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2899522) 
64-Bit Edition"}, "97e39aae-1ed5-4012-ac01-7aa48244be69": {"kb": 
["2883048"], "installed": true, "id": 
"97e39aae-1ed5-4012-ac01-7aa48244be69", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Publisher 2013 (KB2883048) 
64-Bit Edition"}, "2e230dae-eea4-4419-9f70-08589e6806f7": {"kb": 
["2827228"], "installed": true, "id": 
"2e230dae-eea4-4419-9f70-08589e6806f7", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2827228) 
64-Bit Edition"}, "48265146-97af-4f95-802c-67874419": {"kb": 
["2920754"], "installed": true, "id": 
"48265146-97af-4f95-802c-67874419", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2920754) 
64-Bit Edition"}, "845cc8a4-3380-4bdb-a065-4e50449d0578": {"kb": 
["2760344"], "installed": true, "id": 
"845cc8a4-3380-4bdb-a065-4e50449d0578", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2760344) 
64-Bit Edition"}, "99b5d38e-e7bb-4198-8311-fcd03d4b07f3": {"kb": 
["2850064"], "installed": true, "id": 
"99b5d38e-e7bb-4198-8311-fcd03d4b07f3", "categories": ["Office 2013", 
"Security Updates"], "title": "Security Update for Microsoft Office 2013 
(KB2850064) 64-Bit Edition"}, "fc854b57-5c06-45e3-a063-79a5f24d16c6": 
{"kb": ["3039720"], "installed": true, "id": 
"fc854b57-5c06-45e3-a063-79a5f24d16c6", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB3039720) 
64-Bit Edition"}, "1fb63fd7-7c93-440c-af81-29a40c4ab7c0": {"kb": 
["2760249"], "installed": true, "id": 
"1fb63fd7-7c93-440c-af81-29a40c4ab7c0", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2760249) 
64-Bit Edition"}, "027ab55f-e9cc-4faa-a1f0-11477f1c5ab3": {"kb": 
["2881035"], "installed": true, "id": 
"027ab55f-e9cc-4faa-a1f0-11477f1c5ab3", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Office 2013 (KB2881035) 
64-Bit Edition"}, "1ac0fe06-4522-49ea-8200-76aa79641ec3": {"kb": 
["2817301"], "installed": true, "id": 
"1ac0fe06-4522-49ea-8200-76aa79641ec3", "categories": ["Critical Updates", 
"Office 2013"], "title": "Update for Microsoft Visio Viewer 2013 
(KB2817301) 64-Bit Edition"}, "72ff9e43-7f4c-4409-a581-0c656a734fc9": 

[ansible-project] Re: aws ec2 add new ebs volume error

2020-02-06 Thread Work-Hard
(ec2_vol) the module is not supported by anisble

On Thursday, February 6, 2020 at 7:26:11 PM UTC-8, Sandy Hung wrote:
>
> Dear all:
>
> please help me thanks.  
>
> - name: Create New EBS volume
>  ec2_vol:
>aws_access_key: "{{ aws_access_key }}"
>aws_secret_key: "{{ aws_secret_key }}"
>instance_id: "{{ instance_id }}"
>volume_size: "{{ volume_size }}"
>device_name: "{{ device_name}}"
>region: "{{ region }}"
>volume_type: "{{ volume_type }}"
>  register: ec2_vol
>
>
> [WARNING]: Found variable using reserved name: name
>
>
> PLAY [localhost] 
> 
>
> TASK [Create Snapshot EC2] 
> **
> changed: [localhost]
>
> TASK [Create New EBS volume] 
> 
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported 
> parameters for (ec2_vol) module: instance_id Supported parameters include: 
> aws_access_key, aws_secret_key, debug_botocore_endpoint_logs, 
> delete_on_termination, device_name, ec2_url, encrypted, id, instance, iops, 
> kms_key_id, name, profile, region, security_token, snapshot, state, tags, 
> validate_certs, volume_size, volume_type, zone"}
>
> PLAY RECAP 
> **
> localhost  : ok=1changed=1unreachable=0
> failed=1skipped=0rescued=0ignored=0
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8419df9b-e6c2-4d28-943d-119da384d1cc%40googlegroups.com.


[ansible-project] Anible windows script get stuck for my of my machine - Although reboot command is provided to reboot if required. any idea, why ?

2020-02-06 Thread Work-Hard
*Ansible:- *
---
- hosts: windows
  vars:
ansible_connection: winrm
ansible_ssh_port: 5986
anisble_winrm_transport: kerberos
ansible_winrm_server_cert_validation: ignore
validate_certs: false
ansible_winrm_scheme: https
ansibe_winrm_read_timeout_sec: 30
win_updates:
  - SecurityUpdates
  - CriticalUpdates
  - UpdateRollups
  - Definition Updates
  - Updates
  - Windows Server 2016
  - Windows Defender
  - Feature Packs
  - Silverlight
  - Realtek Semiconductor Corp. - Extension - 10.0.17134.1
  tasks:
   - name: Searching updates
 win_updates:
   state: searched
   catagory_names: "{{ win_updates }}"
 register: update_count
 ignore_errors: yes

   - name: reboot if required
 win_reboot:
 when: update_count.reboot_required
 ignore_errors: yes

   - name: Install customized updates as required for MedQIA
 win_updates:
   category_names: "{{ win_updates }}"
   whitelist:
- KB4056892
- KB4073117
- KB2267602
- KB4494452
- KB4534307
- KB4481252
- KB4532938
- KB4528760
   state: installed
   register: update_result
   reboot: yes

*   - name: updating drivers on updates
<<--Issue is here*
* win_updates:*
*   catagory_names: "{{ win_updates }}"*
*   reboot: yes*
* register: update_result*

   - name: Ensure WinRM starts when the system has settled and is ready to 
work reliably
 win_service:
   name: WinRM
   start_mode: delayed

   - name: Ensure we wait long enough for the updates to be applied during 
reboot
 win_updates:
   reboot: yes
   reboot_timeout: 3600


*Ansible Output:*

PLAY [windows] 
*

TASK [Gathering Facts] 
*
ok: [computer_n...@domain.name.com]

TASK [Searching updates] 
***
ok: [computer_n...@domain.name.com]

TASK [reboot if required] 
**
skipping: [computer_n...@domain.name.com]

TASK [Install customized updates as required for MedQIA] 
***
ok: [computer_n...@domain.name.com]

TASK [updating drivers on updates] 
*

*Stuck here ...*

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/74fa7a15-9b5c-4ad4-9599-f75581569540%40googlegroups.com.


Re: [ansible-project] Re: Migrating playbook from ubuntu to amazon linux 2 - throws error missing dependency: python-apt

2020-02-05 Thread Work-Hard
Thanks for the update. I was able to figure it out!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0e078549-7ce4-49d0-a269-a3656f665d19%40googlegroups.com.


Re: [ansible-project] Re: Migrating playbook from ubuntu to amazon linux 2 - throws error missing dependency: python-apt

2020-02-05 Thread Work-Hard
So, I am breaking it down in the playbook -  *it doesn't like spaces in 
name of the package?*
*playbook:*
---
- hosts: amazonlinux2
  become: true
  any_errors_fatal: true
  serial: 1
  max_fail_percentage: 0
  vars:
ansible_user: ec2-user
  tasks:
# do an "yum update", to ensure latest package lists
- name: yum update
  package:
name: yum update
state: present
update_cache: true

*Out-put:*
fatal: [10.0.2.144]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"allow_downgrade": false,
"autoremove": false,
"bugfix": false,
"conf_file": null,
"disable_excludes": null,
"disable_gpg_check": false,
"disable_plugin": [],
"disablerepo": [],
"download_dir": null,
"download_only": false,
"enable_plugin": [],
"enablerepo": [],
"exclude": [],
"install_repoquery": true,
"install_weak_deps": true,
"installroot": "/",
"list": null,
"lock_timeout": 30,
"name": [
"yum update"
],
"releasever": null,
"security": false,
"skip_broken": false,
"state": "present",
"update_cache": true,
"update_only": false,
"use_backend": "auto",
"validate_certs": true
}
},
"msg": "It appears that a space separated string of packages was passed 
in as an argument. To operate on several packages, pass a comma separated 
string of packages or a list of packages."
}





-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/52fb9d1c-b2ee-4861-93b4-7439b6bf6ab5%40googlegroups.com.


[ansible-project] Migrating playbook from ubuntu to amazon linux 2 - throws error missing dependency: python-apt

2020-02-04 Thread Work-Hard
Hello,
Do you recommend Migrating playbook from ubuntu to amazon Linux 2 (as it 
uses *yum instead of apt*). If so, how can I check if missing add a package 
to a new instance to make sure it installs python-apt*?*
*Ansible-Playbook*
---
- hosts: amazonlinux2
  become: true
  any_errors_fatal: true
  serial: 1
  max_fail_percentage: 0
  vars:
ansible_user: ec2-user
  tasks:
# do an "apt-get update", to ensure latest package lists
- name: apt-get update
  apt:
update-cache: yes
  changed_when: 0

# get a list of packages that have updates
- name: get list of pending upgrades
  command: apt-get --simulate dist-upgrade
  args:
warn: false # don't warn us about apt having its own plugin
  register: apt_simulate
  changed_when: 0

- name: Update cache
  apt:
update-cache: yes
  changed_when: false

- name: Fetch package list of updates
  command: apt list --upgradable
  register: aptlist

- set_fact:
updates: "{{ aptlist.stdout_lines | difference(['Listing...'])
| map('regex_replace', '^(.*?)/(.*)', '\\1') | list }}"

- debug: var=updates

# tell user about packages being updated
- name: show pending updates
  debug:
var: updates
  when: updates.0 is defined

# comment this part in if you want to manually ack each server update
- pause:
  when: updates.0 is defined

# if a new kernel is incoming, remove old ones to avoid full /boot
- name: apt-get autoremove
  command: apt-get -y autoremove
  args:
warn: false
  when: '"Inst linux-image-" in apt_simulate.stdout'
  changed_when: 0

# do the actual apt-get dist-upgrade
- name: apt-get dist-upgrade
  apt:
upgrade: dist # upgrade all packages to latest version
  register: upgrade_output

# check if we need a reboot
- name: check if reboot needed
  stat: path=/var/run/reboot-required
  register: file_reboot_required

# "meta: end_play" aborts the rest of the tasks in the current «tasks:»
# section, for the current webserver
# "when:" clause ensures that the "meta: end_play" only triggers if the
# current server does _not_ need a reboot
- meta: end_play
  when: not file_reboot_required.stat.exists

# because of the above meta/when we at this point know that the current
# host needs a reboot

# prompt for manual input before doing the actual reboot
- name: Confirm reboot of ec2-user
  pause:

- name: reboot node
  shell: sleep 2 && shutdown -r now "Reboot triggered by ansible"
  async: 1
  poll: 0
  ignore_errors: true

# poll ssh port until we get a tcp connect
- name: wait for node to finish booting
  become: false
  local_action: wait_for host=ec2-user
  port=22
  state=started
  delay=5
  timeout=600

# give sshd time to start fully
- name: wait for ssh to start fully
  pause:
seconds: 15

# wait a few minutes between hosts, unless we're on the last
- name: waiting between hosts
  pause:
minutes: 10
  when: inventory_hostname != ansible_play_hosts[-1]


*Ansible-Output*
PLAY [amazonlinux2] 
**

TASK [Gathering Facts] 
***
[WARNING]: Platform linux on host 10.11.12.13 is using the discovered 
Python interpreter at /usr/bin/python, but future installation of another 
Python
interpreter could change this. See 
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html
 
for more information.

ok: [10.11.12.13]

TASK [apt-get update] 

[WARNING]: Updating cache and auto-installing *missing dependency: 
python-apt*

fatal: [10.11.12.13]: FAILED! => {"changed": false, "cmd": "apt-get 
update", "msg": "[Errno 2] No such file or directory", "rc": 2}

NO MORE HOSTS LEFT 
***

NO MORE HOSTS LEFT 
***

PLAY RECAP 
***
10.11.12.13 : ok=1changed=0unreachable=0
failed=1skipped=0rescued=0ignored=0


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop 

Re: [ansible-project] Error while readin split part for updating Ubuntu packages - Should I include the path of splitpath,py in playbook ?

2020-02-04 Thread Work-Hard
Great! Thanks that worked but I had to modify the syntax in the set fact to 
make it work. 
- name: Check for pending updates
  become: true
  hosts: all

  tasks:
- name: Update cache
  apt:
update-cache: yes
  changed_when: false

- name: Fetch package list of updates
  command: apt list --upgradable
  register: aptlist

- set_fact:
updates: "{{ aptlist.stdout_lines | difference(['Listing...'])
| map('regex_replace', '^(.*?)/(.*)', '\\1') | list }}"

On Monday, February 3, 2020 at 11:57:21 PM UTC-8, Dick Visser wrote:
>
> Hii 
>
> "splitpath.py" isn't a valid key for the config file. The correct one 
> is "filter_plugins", see: 
>
> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-filter-plugin-path
>  
>
> But I don't see why you would need such heavy weapons if all you want 
> is a list of package names that have pending updates. 
> This should roughly do the same, without the complexity of custom filters: 
>
>
> - name: Check for pending updates 
>   become: true 
>   hosts: all 
>
>   tasks: 
> - name: Update cache 
>   apt: 
> update-cache: yes 
>   changed_when: false 
>
> - name: Fetch package list of updates 
>   command: apt list --upgradable 
>   register: aptlist 
>
> - set_fact: 
> updates: "{{ aptlist.stdout_lines | difference(['Listing...']) 
> | map('regex_replace', '^(.*?)\/(.*)', '\\1') | list }}" 
>
> - debug: var=updates 
>
>
> On Tue, 4 Feb 2020 at 01:12, Work-Hard > 
> wrote: 
> > 
> > Hello, Please see below 
> > ansible.cfg 
> > [defaults] 
> > inventory = ./hosts 
> > 
> > splitpart.py = /etc/ansible/splitpart.py/ 
> > 
> > splitpart.py 
> > def splitpart (value, index, char = ','): 
> > if isinstance(value, (list, tuple)): 
> > ret = [] 
> > for v in value: 
> > ret.append(v.split(char)[index]) 
> > return ret 
> > else: 
> > return value.split(char)[index] 
> > 
> > class FilterModule(object): 
> > def filters(self): 
> > return {'splitpart': splitpart 
> > 
> > 
> > playbook 
> >   tasks: 
> > # do an "apt-get update", to ensure latest package lists 
> > - name: apt-get update 
> >   apt: 
> > update-cache: yes 
> >   changed_when: 0 
> > 
> > # get a list of packages that have updates 
> > - name: get list of pending upgrades 
> >   command: apt-get --simulate dist-upgrade 
> >   args: 
> > warn: false # don't warn us about apt having its own plugin 
> >   register: apt_simulate 
> >   changed_when: 0 
> > 
> > # pick out list of pending updates from command output. This 
> essentially 
> > # takes the above output from "apt-get --simulate dist-upgrade", and 
> > # pipes it through "cut -f2 -d' ' | sort" 
> > - name: parse apt-get output to get list of changed packages 
> >   set_fact: 
> > updates: '{{ apt_simulate.stdout_lines | select("match", "^Inst 
> ") | list | splitpart(1, " ") | list | sort }}' 
> >   changed_when: 0 
> > 
> > # tell user about packages being updated 
> > - name: show pending updates 
> >   debug: 
> > var: updates 
> >   when: updates.0 is defined 
> > 
> > 
> > playbook output 
> > 
> > PLAY [myotherserver] 
> *
>  
>
> > 
> > TASK [Gathering Facts] 
> ***
>  
>
> > ok: [10.0.2.236] 
> > 
> > TASK [apt-get update] 
> 
>  
>
> > ok: [10.0.2.236] 
> > 
> > TASK [get list of pending upgrades] 
> **
>  
>
> > ok: [10.0.2.236] 
> > 
> > TASK [parse apt-get output to get list of changed packages] 
> **
>  
>
> > fatal: [10.0.2.236]: FAILED! => {"msg": "template error while templating 
> string: no filter named 'splitpart

[ansible-project] Error while readin split part for updating Ubuntu packages - Should I include the path of splitpath,py in playbook ?

2020-02-03 Thread Work-Hard
*Hello, Please see below*
*ansible.cfg*
[defaults]
inventory = ./hosts

splitpart.py = /etc/ansible/splitpart.py/

*splitpart.py*
def splitpart (value, index, char = ','):
if isinstance(value, (list, tuple)):
ret = []
for v in value:
ret.append(v.split(char)[index])
return ret
else:
return value.split(char)[index]

class FilterModule(object):
def filters(self):
return {'splitpart': splitpart


*playbook*
  tasks:
# do an "apt-get update", to ensure latest package lists
- name: apt-get update
  apt:
update-cache: yes
  changed_when: 0

# get a list of packages that have updates
- name: get list of pending upgrades
  command: apt-get --simulate dist-upgrade
  args:
warn: false # don't warn us about apt having its own plugin
  register: apt_simulate
  changed_when: 0

# pick out list of pending updates from command output. This essentially
# takes the above output from "apt-get --simulate dist-upgrade", and
# pipes it through "cut -f2 -d' ' | sort"
- name: parse apt-get output to get list of changed packages
  set_fact:
updates: '{{ apt_simulate.stdout_lines | select("match", "^Inst ") 
| list | splitpart(1, " ") | list | sort }}'
  changed_when: 0

# tell user about packages being updated
- name: show pending updates
  debug:
var: updates
  when: updates.0 is defined


*playbook output*

PLAY [myotherserver] 
*

TASK [Gathering Facts] 
***
ok: [10.0.2.236]

TASK [apt-get update] 

ok: [10.0.2.236]

TASK [get list of pending upgrades] 
**
ok: [10.0.2.236]

TASK [parse apt-get output to get list of changed packages] 
**
fatal: [10.0.2.236]: FAILED! => {"msg": "template error while templating 
string: no filter named 'splitpart'. String: {{ apt_simulate.stdout_lines | 
select(\"match\", \"^Inst \") | list | splitpart(1, \" \") | list | sort 
}}"}

PLAY RECAP 
***
10.0.2.236 : ok=3changed=0unreachable=0
failed=1skipped=0rescued=0ignored=0

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9de09a5f-1173-43b7-a2d7-3332ba0e060d%40googlegroups.com.


[ansible-project] Re: please advise - Not generating logs after with ansible log_group

2020-02-03 Thread Work-Hard
Any updates are appreciated?

On Friday, January 31, 2020 at 7:11:19 AM UTC-8, Work-Hard wrote:
>
> If you have an example for the playbook and other config to log 
> ansible-recap, please share
>
> On Thursday, January 30, 2020 at 4:12:52 PM UTC-8, Work-Hard wrote:
>>
>> I am unable to generate logs with the playbook. Please advise?
>>
>> *ansible.cfg*
>> [defaults]
>> inventory = ./hosts
>>
>> [callback_log_plays]
>> log_folder = /var/log/ansible/hosts
>> env:ANSIBLE_LOG_FOLDER
>>
>>
>> *host file *
>> [windows]
>> windows mach...@abc.com
>>
>> [windows:vars]
>> ansible_connection = winrm
>> ansible_ssh_port = 5986
>> ansible_winrm_transport = kerberos
>> ansible_winrm_server_cert_validation = ignore
>> validate_certs = false
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5d8a1db9-635f-4968-b28c-e15cde6f2a7e%40googlegroups.com.


[ansible-project] Re: please advise - Not generating logs after with ansible log_group

2020-01-31 Thread Work-Hard
If you have an example for the playbook and other config to log 
ansible-recap, please share

On Thursday, January 30, 2020 at 4:12:52 PM UTC-8, Work-Hard wrote:
>
> I am unable to generate logs with the playbook. Please advise?
>
> *ansible.cfg*
> [defaults]
> inventory = ./hosts
>
> [callback_log_plays]
> log_folder = /var/log/ansible/hosts
> env:ANSIBLE_LOG_FOLDER
>
>
> *host file *
> [windows]
> windows mach...@abc.com
>
> [windows:vars]
> ansible_connection = winrm
> ansible_ssh_port = 5986
> ansible_winrm_transport = kerberos
> ansible_winrm_server_cert_validation = ignore
> validate_certs = false
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/eb592c4f-2583-4828-8f27-9174184eec1c%40googlegroups.com.


[ansible-project] please advise - Not generating logs after with ansible log_group

2020-01-30 Thread Work-Hard
I am unable to generate logs with the playbook. Please advise?

*ansible.cfg*
[defaults]
inventory = ./hosts

[callback_log_plays]
log_folder = /var/log/ansible/hosts
env:ANSIBLE_LOG_FOLDER


*host file *
[windows]
windows mach...@abc.com

[windows:vars]
ansible_connection = winrm
ansible_ssh_port = 5986
ansible_winrm_transport = kerberos
ansible_winrm_server_cert_validation = ignore
validate_certs = false

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e1f85b4f-be54-4688-8e8a-3f59406a459e%40googlegroups.com.


[ansible-project] Kerberos error

2020-01-30 Thread Work-Hard
I don;t know why i keep getting Kerberos error on every new machine, Any 
idea?

HTTPSConnectionPool(host='workstation', port=5986): Max retries exceeded 
with url: /wsman (Caused by 
NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or 
service not known',))",
"unreachable": true

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/34548d9d-dc8f-43a8-9035-3344b439480b%40googlegroups.com.


[ansible-project] Re: Quick question- how to run ansible playbook on Saturday night at 12 PM and save the output in amazon s3 bucket

2020-01-29 Thread Work-Hard
I am in Ubuntu. Can you share template of your shell script {output to a 
file and copy the file to s3}. I can't use ssh-agent as it involves windows 
workstations on-premises (outside aws). I tried to use it before but it's a 
lot of overhead/un-reliable process.

On Wednesday, January 29, 2020 at 9:06:05 AM UTC-8, Dylan Martin wrote:
>
> What environment are you in?
>
> I have linux servers in a datacenter.  I'd write a shell script to run the 
> play, output to a file and copy the file to s3.  Then I'd use cron to 
> schedule the job.  Of course, you'd need to use a passwordless ssh key or 
> set up ssh-agent ahead of time to work with cron, which can be a little 
> tricky.
>
> So, basically how you'd schedule any task, with extra attention paid to 
> the ssh auth.
>
> On Monday, January 27, 2020 at 11:08:26 PM UTC-8, Work-Hard wrote:
>>
>> Quick question- how to run ansible-playbook on Saturday night at 12 PM 
>> and save the output in the amazon s3 bucket- "abc"?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d1bcca2-ee06-411c-9ea1-7a5e8b741dd1%40googlegroups.com.


[ansible-project] Re: Quick question- how to run ansible playbook on Saturday night at 12 PM and save the output in amazon s3 bucket

2020-01-28 Thread Work-Hard
Any update is appreciated!

On Monday, January 27, 2020 at 11:08:26 PM UTC-8, Work-Hard wrote:
>
> Quick question- how to run ansible-playbook on Saturday night at 12 PM and 
> save the output in the amazon s3 bucket- "abc"?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cf652d52-a521-4756-ba4d-b66daa6ea209%40googlegroups.com.


[ansible-project] Quick question- how to run ansible playbook on Saturday night at 12 PM and save the output in amazon s3 bucket

2020-01-27 Thread Work-Hard
Quick question- how to run ansible-playbook on Saturday night at 12 PM and 
save the output in the amazon s3 bucket- "abc"?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e9343caa-893c-4723-b2c4-561822b1782f%40googlegroups.com.


[ansible-project] Re: What is the module to install drivers?

2020-01-24 Thread Work-Hard
changed - catagory_names to category_names.. Will try again but will the 
driver update ? please let me know

On Friday, January 24, 2020 at 4:03:45 PM UTC-8, Work-Hard wrote:
>
> it's filtering now 
> vars :
> win_updates:
>  - SecurityUpdates
>  - CriticalUpdates
>  - UpdateRollups
>  - Definition Updates
>  - Updates
>  - Windows Server 2016
>  - Windows Defender
>  - Feature Packs
>  - Silverlight
>  - Upgrades
>  - Windows 10
>  - Drivers
>   tasks:
> - name: check for missing updates
>   win_updates:
> state: searched
> catagory_names: "{{ win_updates }}"
>   register: update_count
>   ignore_errors: yes
>
> - name: reboot if required
>   win_reboot:
>   when: update_count.reboot_required
>   ignore_errors: yes
>
> - name: install updates
>   win_updates:
> catagory_names: "{{ win_updates }}"
> reboot: yes
>   register: update_result
>
> *OUTPUT*
> "changed": false,
> "filtered_updates": {
> "65ecc208-c6b1-4fce-b892-fc2c93917d76": {
> "categories": [
> "Drivers"
> ],
> "filtered_reason": "category_names",
> "id": "65ecc208-c6b1-4fce-b892-fc2c93917d76",
> "installed": false,
> "kb": [],
> "title": "Logitech - Image - 10/24/2018 12:00:00 AM - 1.3.89.0"
> },
> "79bfbb87-ae9d-480d-9f6f-5c82361e015d": {
> "categories": [
> "Upgrades"
> ],
> "filtered_reason": "category_names",
> "id": "79bfbb87-ae9d-480d-9f6f-5c82361e015d",
> "installed": false,
> "kb": [
> "4530684"
> ],
> "title": "Feature update to Windows 10, version 1909"
> },
> "9dd000db-ce7e-48cc-b7e9-0508ee8e6c56": {
> "categories": [
> "Updates",
> "Windows 10"
> ],
> "filtered_reason": "category_names",
> "id": "9dd000db-ce7e-48cc-b7e9-0508ee8e6c56",
> "installed": false,
> "kb": [
> "4534129"
> ],
> "title": "2020-01 Cumulative Update for .NET Framework 4.8 for 
> Windows 10 Version 1709 for x64 (KB4534129)"
> }
> },
> "found_update_count": 0,
> "installed_update_count": 0,
> "reboot_required": false,
> "updates": {}
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d1fabaa2-990f-4a78-a34e-31557ca0d737%40googlegroups.com.


[ansible-project] Re: What is the module to install drivers?

2020-01-24 Thread Work-Hard
it's filtering now 
vars :
win_updates:
 - SecurityUpdates
 - CriticalUpdates
 - UpdateRollups
 - Definition Updates
 - Updates
 - Windows Server 2016
 - Windows Defender
 - Feature Packs
 - Silverlight
 - Upgrades
 - Windows 10
 - Drivers
  tasks:
- name: check for missing updates
  win_updates:
state: searched
catagory_names: "{{ win_updates }}"
  register: update_count
  ignore_errors: yes

- name: reboot if required
  win_reboot:
  when: update_count.reboot_required
  ignore_errors: yes

- name: install updates
  win_updates:
catagory_names: "{{ win_updates }}"
reboot: yes
  register: update_result

*OUTPUT*
"changed": false,
"filtered_updates": {
"65ecc208-c6b1-4fce-b892-fc2c93917d76": {
"categories": [
"Drivers"
],
"filtered_reason": "category_names",
"id": "65ecc208-c6b1-4fce-b892-fc2c93917d76",
"installed": false,
"kb": [],
"title": "Logitech - Image - 10/24/2018 12:00:00 AM - 1.3.89.0"
},
"79bfbb87-ae9d-480d-9f6f-5c82361e015d": {
"categories": [
"Upgrades"
],
"filtered_reason": "category_names",
"id": "79bfbb87-ae9d-480d-9f6f-5c82361e015d",
"installed": false,
"kb": [
"4530684"
],
"title": "Feature update to Windows 10, version 1909"
},
"9dd000db-ce7e-48cc-b7e9-0508ee8e6c56": {
"categories": [
"Updates",
"Windows 10"
],
"filtered_reason": "category_names",
"id": "9dd000db-ce7e-48cc-b7e9-0508ee8e6c56",
"installed": false,
"kb": [
"4534129"
],
"title": "2020-01 Cumulative Update for .NET Framework 4.8 for 
Windows 10 Version 1709 for x64 (KB4534129)"
}
},
"found_update_count": 0,
"installed_update_count": 0,
"reboot_required": false,
"updates": {}

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5cddfe67-661f-4cbd-93b3-c82a93cff37f%40googlegroups.com.


[ansible-project] What is the module to install drivers?

2020-01-24 Thread Work-Hard
What is the module to install drivers ? it's not working with win_updates.
===
"changed": false,
"filtered_updates": {
"3ae62049-cfd0-482e-b95b-e44f346aa156": {
"categories": [
"Drivers"
],
"filtered_reason": "category_names",
"id": "3ae62049-cfd0-482e-b95b-e44f346aa156",
"installed": false,
"kb": [],
"title": "*Realtek Semiconductor Corp. - Extension - 
10.0.17134.1*"
}
},
"found_update_count": 0,
"installed_update_count": 0,
"reboot_required": false,
"updates": {}

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/31c343bf-6668-4557-afd7-349de1dc7775%40googlegroups.com.


Re: [ansible-project] Re: can someone please explain about "undefined" error

2020-01-24 Thread Work-Hard
Got it thanks

On Friday, January 24, 2020 at 6:07:34 AM UTC-8, Karl Auer wrote:
>
> To expand on what Eric said:
>
> Your when: condition refers to a variable called "update_count".
>
> At the point where you refer to it, that variable does not exist. I bolded 
> the bits of the error message that really matter:
>
> TASK [reboot if required] **
> 
> **
> task path: /etc/ansible/windows-playbook/copied.yml:22
> *fatal*: [EC2AMAZ-9M186EG.corp.medqia.com]: FAILED! => {
> "msg": "The conditional check 'update_count.reboot_required' failed. 
> The error was: error while evaluating conditional 
> (update_count.reboot_required): *'update_count' is undefined*\n\n.\n\nThe 
> offending line appears to be:\n\n  tasks:\n   - name: reboot if required\n  
>^ here\n"
> }
>
> Common reasons for this error include:
> - you misspelled it
> - you got the CaPiTaLiSaTiOn wrong
> - you defined it after first reference
> - you defined it for a host other than EC2AMAZ-9M186EG.corp.medqia.com
> - you defined it in a vars file that is not being loaded
> - you defined it in a vars file that is not being referenced
> - you defined it somewhere where it cannot be referenced
> - you rearranged your code and accidentally moved the definition to after 
> the first reference
> - update_count is a field or element of something bigger you forgot to 
> reference first
> - you didn't define it at all
>
> If you'd like more help, post the ENTIRE playbook here (or make it 
> available in e.g. pastebin). Don't post anything confidential though.
>
> Please post code in a fixed-width font so we can see the indentation.
>
> Regards, K.
>
> On Sat, Jan 25, 2020 at 12:24 AM 'Eric Hymowitz' via Ansible Project <
> ansible...@googlegroups.com > wrote:
>
>> At the risk of being rude, I'm not sure what you don't understand.
>>
>> You're querying a hash variable update_count , and looking for the member 
>> named reboot_required .  Where did you define this variable?  If you don't 
>> define a variable, then the variable is undefined.
>>
>> Is there more to this playbook that you didn't provide?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/5c5985b8-32a6-4334-aa09-c0e8814af823%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> *Karl Auer* { manager, systems support }
> P: 1300 759 975
> E: ka...@2pisoftware.com 
> 2pisoftware.com
>
> GPG/PGP : 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
> Previous: 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5a15e971-fbf0-4dc9-8e74-04bac130402a%40googlegroups.com.


[ansible-project] can someone please explain about "undefined" error

2020-01-23 Thread Work-Hard
Hello Guys,
can someone please explain about "undefined" error

Task
   - name: reboot if required
 win_reboot:
 when: update_count.reboot_required

TASK [reboot if required] 

task path: /etc/ansible/windows-playbook/copied.yml:22
fatal: [EC2AMAZ-9M186EG.corp.medqia.com]: FAILED! => {
"msg": "The conditional check 'update_count.reboot_required' failed. 
The error was: error while evaluating conditional 
(update_count.reboot_required): 'update_count' is undefined\n\n.\n\nThe 
offending line appears to be:\n\n  tasks:\n   - name: reboot if required\n  
   ^ here\n"
}

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab562a70-62ee-48e3-b967-c090cd797fae%40googlegroups.com.


Re: [ansible-project] Playbook is unable to install specified KB number updates but shows OK in playbook recap

2020-01-23 Thread Work-Hard

*Thank you, it worked*


On Thursday, January 23, 2020 at 12:24:04 PM UTC-8, Jordan Borean wrote:
>
> Then finally for your last message, I've already told you in 
> https://groups.google.com/forum/#!topic/ansible-project/ME6fY1n7SCA why 
> it's failing the reboot check.
>
> Firstly
>
>1. The reboot option in win_updates is 'reboot: yes', not 'win_reboot: 
>yes', you would know that if you had read the docs and understand how the 
>options work. The win_reboot module is a completely separate module 
>2. I've said in your original post that the win_updates module only 
>handles reboots post installation, if a reboot is required before the 
>install it won't do that
>
> Arguably 2 is something that we can do but it's just not something that is 
> available right now. Feel free to submit a PR to add that functionality if 
> you desire it.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0acec0f9-83a1-4ee3-8271-e03241912870%40googlegroups.com.


[ansible-project] Re: Playbook is stuck, is it bug ?

2020-01-23 Thread Work-Hard
it took half an hour to run it and it's working normally now. Was it a BUG?

On Thursday, January 23, 2020 at 4:33:06 PM UTC-8, Work-Hard wrote:
>
> *Hello guys,*
> *My playbook seems to be stuck for 5 mins for 1 server. Is it bug ?*
>   tasks:
>- name: Search and download Windows updates without installing them
>  win_updates:
>category_names:
> - SecurityUpdates
> - CriticalUpdates
> - UpdateRollups
> - Definition Updates
> - Windows Defender
> - Windows Server 2016
> - Updates
> - Silverlight
> - Feature Packs
>reboot: yes
>
> *Actual Result - *
> ansible-playbook 2.9.2
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = [u'/root/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.7/dist-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 2.7.12 (default, Oct  8 2019, 14:14:10) [GCC 5.4.0 
> 20160609]
> Using /etc/ansible/ansible.cfg as config file
> host_list declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
> script declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
> auto declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
> Parsed /etc/ansible/hosts inventory source with ini plugin
>
> PLAYBOOK: testing.yml 
> 
> 1 plays in testing.yml
>
> PLAY [windows] 
> ***
>
> TASK [Gathering Facts] 
> ***
> task path: /etc/ansible/windows-playbook/testing.yml:2
> Using module file 
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
> Pipelining is enabled.
>  ESTABLISH WINRM CONNECTION FOR USER: 
> None on PORT 5986 TO EC2AMAZ-9M186EG.corp.medqia.com
> EXEC (via pipeline wrapper)
> ok: [EC2AMAZ-9M186EG.corp.medqia.com]
> META: ran handlers
>
> TASK [Search and download Windows updates without installing them] 
> ***
> task path: /etc/ansible/windows-playbook/testing.yml:12
> win_updates: running win_updates module
> Using module file 
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_updates.ps1
> Pipelining is enabled.
>  ESTABLISH WINRM CONNECTION FOR USER: 
> None on PORT 5986 TO EC2AMAZ-9M186EG.corp.medqia.com
> EXEC (via pipeline wrapper)
>
> thanks in advance for your help!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e0ed25ed-0a92-4099-a2f4-71ade939b078%40googlegroups.com.


[ansible-project] Playbook is stuck, is it bug ?

2020-01-23 Thread Work-Hard
*Hello guys,*
*My playbook seems to be stuck for 5 mins for 1 server. Is it bug ?*
  tasks:
   - name: Search and download Windows updates without installing them
 win_updates:
   category_names:
- SecurityUpdates
- CriticalUpdates
- UpdateRollups
- Definition Updates
- Windows Defender
- Windows Server 2016
- Updates
- Silverlight
- Feature Packs
   reboot: yes

*Actual Result - *
ansible-playbook 2.9.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.12 (default, Oct  8 2019, 14:14:10) [GCC 5.4.0 
20160609]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its 
verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its 
verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its 
verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin

PLAYBOOK: testing.yml 

1 plays in testing.yml

PLAY [windows] 
***

TASK [Gathering Facts] 
***
task path: /etc/ansible/windows-playbook/testing.yml:2
Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/windows/setup.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: None 
on PORT 5986 TO EC2AMAZ-9M186EG.corp.medqia.com
EXEC (via pipeline wrapper)
ok: [EC2AMAZ-9M186EG.corp.medqia.com]
META: ran handlers

TASK [Search and download Windows updates without installing them] 
***
task path: /etc/ansible/windows-playbook/testing.yml:12
win_updates: running win_updates module
Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/windows/win_updates.ps1
Pipelining is enabled.
 ESTABLISH WINRM CONNECTION FOR USER: None 
on PORT 5986 TO EC2AMAZ-9M186EG.corp.medqia.com
EXEC (via pipeline wrapper)

thanks in advance for your help!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/94f4585d-1340-46b3-b204-da9346ee07bd%40googlegroups.com.