Hi Benny,

As far as I know, Ansible doesn't have any modules which can do inital
configuration of an ILO. However, You can automate the ILO configuration
using HP Oneview along with ansible.  You can find the details in this url
: https://h20195.www2.hpe.com/v2/getpdf.aspx/4AA6-6348ENW.pdf

Regards,
Amarjeet

On Tue, Apr 10, 2018 at 9:08 AM, Dave H <d...@castledesigns.co.uk> wrote:

> Hi Benny,
>
> There are a couple of development modules in the ansible docs, e.g.
> https://docs.ansible.com/ansible/devel/modules/hpilo_boot_module.html,
> but I have not used them.
>
> I use the python package from http://seveas.github.io/python-hpilo to
> expose a command line interface and use an example playbook like the
> following. You have to extract data from the output of the cli but it's
> fairly straightforward and very useful.
>
> ansible-playbook -i "localhost," -c local playbook.yml
>
> ---
>
> - hosts: localhost
>   gather_facts: false
>
>   vars:
>
>     ilo_host: "192.168.0.10"  # IP address / hostname of the iLO interface
>     ilo_user: "xxxxx"         # username for the user to log into the iLO
>     ilo_password: "xxxxxx"    # fetch from vault or other secret storage
>     hpilo_cli_cmd: "hpilo_cli {{ ilo_host }} --json --login='{{ ilo_user
> }}' --password='{{ ilo_password }}'"
>
>   tasks:
>
>   - name: Get current power status
>     command: "{{ hpilo_cli_cmd }} get_host_power_status"
>     register: hpilo_cli_get_host_power_status
>
>   - name: Record power status
>     set_fact:
>       power_status: "{% if 'ON' in hpilo_cli_get_host_power_status.stdout
> %}ON{% else %}OFF{% endif %}"
>
>   - name: Power on server - if it is powered down
>     command: "{{hpilo_cli_cmd}} press_pwr_btn"
>     when: power_status != "ON"
>
>   - name: Reboot server - if it is powered up
>     command: "{{hpilo_cli_cmd}} cold_boot_server"
>     when: power_status == "ON"
>
> Hope that helps.
>
> Dave
>
>
> On Monday, 9 April 2018 09:37:15 UTC+1, Benny Kusman wrote:
>>
>> Hi,
>>
>> has anyone implemented setting up HP ILO using ansible, when the server
>> has no OS yet ?
>> if the server has been installed and has hponcfg command, there is
>> ansible module for it.
>>
>> But wondering, if anyone has tried to setup the server in the ilo using
>> ansible (just simply specifying the ilo hostname, userid/password, port)
>>
>> 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 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/575de21c-8c32-448a-9f6c-f0567d1157ba%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/575de21c-8c32-448a-9f6c-f0567d1157ba%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/CACLrQb04FjMO3Y-tFrCqETZruj%2BteQyp%3D%3DK%3DmKT6ppjTyyFDTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to