msg: hostname module cannot be used on platform Linux (Neon)

20 views
Skip to first unread message

Emmet Ryan

unread,
May 25, 2017, 11:54:41 AM5/25/17
to Ansible Project
Has anyone else run into issues using the hostname module on KDE Neon hosts? I recently updated to 2.3 which introduces Neon support. This is the task:

  - name: set hostname
    hostname:
      name: "{{ host }}"

and the resulting output:

TASK [workstations/common : set hostname] *************************************************************************************************************
fatal: [eryan3]: FAILED! => {"changed": false, "failed": true, "msg": "hostname module cannot be used on platform Linux (Neon)"}

Kai Stian Olstad

unread,
May 26, 2017, 12:59:26 PM5/26/17
to ansible...@googlegroups.com
On 25. mai 2017 17:56, Emmet Ryan wrote:
> I recently upgraded to Ansible 2.3 for KDE Neon support and ran into the
> following failure when running a playbook against it:
>
> msg: hostname module cannot be used on platform Linux (Neon)

There is noting about Neon in the source
https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/system/hostname.py

>
> And this is the task it failed on:
>
> - name: set hostname
> hostname:
> name: "{{ host }}"
>
> Has anyone found a solution or workaround to this?

IIRC Neon is based on Ubuntu, then you should be able to do this

- name: set hostname
copy:
content: "{{ host }}"
dest: /etc/hostname

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages