Reply
Highlighted

Ansible : add alias to an existing host record

steuk
Techie
Posts: 1
238     0

Hello,

 

I'm able to create a host with an alias using Ansible (based on api rest nios_host_record).

For example, following playbook works perfectly :

tasks:
    - name: configure an ipv4 host record
      nios_host_record:
        name: HOST-NAME
        ipv4:
          - address: IP-ADDRESS
        aliases:
          - HOST-ALIAS
        state: present
        view: "myView"
        provider: "{{nios_provider}}"

 

Now, I have a host created (with 0, 1 or N aliases) and I just want to add a new alias to this host.

The problem is I don't find how to do it.

If I use the same code and only change "HOST-ALIAS" (to put a new one) ansible says that "HOST-NAME" already exists and generate an error (because nios_host_record wants to create a host record).

 

So how can I simply create a new alias for an existing host record ?

 

Thank you.

Re: Ansible : add alias to an existing host record

Posts: 1
239     0

Hello, were you able to solve this. I am facing the same problem.

Showing results for 
Search instead for 
Do you mean 

Recommended for You