Re: [ansible-project] Get "Could not find the requested service" when trying to restart httpd; but it is installed

2018-11-16 Thread Dick Davies
Could not find the requested service ['httpd']: host"}

looks to me like your issue is in the playbook., You're passing an
array ( 'services' ) in as the service name, ansible is treating that
as a length 1 array
rather than just a string. Replace the "{{ services }}" with just :
httpd and I bet it works.
On Thu, 15 Nov 2018 at 13:17, Sean Hederman  wrote:
>
> The pid file is at
>
> /var/run/httpd/httpd.pid
>
>
> How would I check where the stop script expects it to be?
>
>
> On Thursday, November 15, 2018 at 10:47:47 AM UTC, Karl Auer wrote:
>>
>> This is almost certainly to do with the PID file.
>>
>> Check that it is where the stop script expects it to be.
>>
>> Regards, K.
>>
>>
>> On Thu, Nov 15, 2018 at 9:44 PM Sean Hederman  wrote:
>>>
>>> - name: Restart Apache
>>> service:
>>> name: "{{ services }}"
>>> state: restarted
>>> enabled: yes
>>> become: true
>>> vars:
>>> services:
>>> - httpd
>>>
>>> Have tried variants with different states, enabled, become. All fail with 
>>> exact same error:
>>> amzn-build: TASK [web_server : Restart Apache] 
>>> * amzn-build: fatal: 
>>> [127.0.0.1]: FAILED! => {"changed": false, "msg": "Could not find the 
>>> requested service ['httpd']: host"}
>>>
>>> Logging onto the instance and running:
>>>
>>> sudo service httpd restart
>>>
>>> Stopping httpd:[FAILED]
>>>
>>> Starting httpd:[  OK  ]
>>>
>>>
>>> Vanilla Amazon 2018.03 image with ansible installed via pip
>>>
>>> I cannot see why ansible would report that httpd does not exist when it 
>>> patently does
>>>
>>> --
>>> 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-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/99d478d2-10a7-449a-b573-b3a83e308232%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Karl Auer
>>
>> Email  : ka...@2pisoftware.com
>> Website: http://2pisoftware.com
>>
>> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
>> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/fb53b56c-a863-4538-93f0-00d7a6a63ffd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK5eLPRDiRUeHfWmnr1qfCLqjNYK2NKMLX0Yu0iTRatL7PAwMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Get "Could not find the requested service" when trying to restart httpd; but it is installed

2018-11-15 Thread Sean Hederman
The pid file is at  

/var/run/httpd/httpd.pid


How would I check where the stop script expects it to be?

On Thursday, November 15, 2018 at 10:47:47 AM UTC, Karl Auer wrote:
>
> This is almost certainly to do with the PID file.
>
> Check that it is where the stop script expects it to be.
>
> Regards, K.
>
>
> On Thu, Nov 15, 2018 at 9:44 PM Sean Hederman  > wrote:
>
>> - name: Restart Apache
>> service:
>> name: "{{ services }}"
>> state: restarted
>> enabled: yes
>> become: true
>> vars:
>> services:
>> - httpd
>>
>> Have tried variants with different states, enabled, become. All fail with 
>> exact same error:
>> amzn-build: TASK [web_server : Restart Apache] 
>> * amzn-build: fatal: 
>> [127.0.0.1]: FAILED! => {"changed": false, "msg": "Could not find the 
>> requested service ['httpd']: host"}
>>
>> Logging onto the instance and running:
>>
>> sudo service httpd restart
>>
>> Stopping httpd:[FAILED]
>>
>> Starting httpd:[  OK  ]
>>
>>
>> Vanilla Amazon 2018.03 image with ansible installed via pip
>>
>> I cannot see why ansible would report that httpd does not exist when it 
>> patently does
>>
>> -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/99d478d2-10a7-449a-b573-b3a83e308232%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Karl Auer
>
> Email  : ka...@2pisoftware.com 
> Website: http://2pisoftware.com
>
> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fb53b56c-a863-4538-93f0-00d7a6a63ffd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Get "Could not find the requested service" when trying to restart httpd; but it is installed

2018-11-15 Thread Karl Auer
This is almost certainly to do with the PID file.

Check that it is where the stop script expects it to be.

Regards, K.


On Thu, Nov 15, 2018 at 9:44 PM Sean Hederman 
wrote:

> - name: Restart Apache
> service:
> name: "{{ services }}"
> state: restarted
> enabled: yes
> become: true
> vars:
> services:
> - httpd
>
> Have tried variants with different states, enabled, become. All fail with
> exact same error:
> amzn-build: TASK [web_server : Restart Apache]
> * amzn-build: fatal:
> [127.0.0.1]: FAILED! => {"changed": false, "msg": "Could not find the
> requested service ['httpd']: host"}
>
> Logging onto the instance and running:
>
> sudo service httpd restart
>
> Stopping httpd:[FAILED]
>
> Starting httpd:[  OK  ]
>
>
> Vanilla Amazon 2018.03 image with ansible installed via pip
>
> I cannot see why ansible would report that httpd does not exist when it
> patently does
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/99d478d2-10a7-449a-b573-b3a83e308232%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08T_aNh6mpi54AXOefWqeC9vkjuU3dSCt_46qVprSLK-%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Get "Could not find the requested service" when trying to restart httpd; but it is installed

2018-11-15 Thread Sean Hederman
- name: Restart Apache
service:
name: "{{ services }}"
state: restarted
enabled: yes
become: true
vars:
services:
- httpd

Have tried variants with different states, enabled, become. All fail with 
exact same error:
amzn-build: TASK [web_server : Restart Apache] 
* amzn-build: fatal: 
[127.0.0.1]: FAILED! => {"changed": false, "msg": "Could not find the 
requested service ['httpd']: host"}

Logging onto the instance and running:

sudo service httpd restart

Stopping httpd:[FAILED]

Starting httpd:[  OK  ]


Vanilla Amazon 2018.03 image with ansible installed via pip

I cannot see why ansible would report that httpd does not exist when it 
patently does

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/99d478d2-10a7-449a-b573-b3a83e308232%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.