446a8917f8
We remove cloud-init but we don't remove the stuff it sucks in. Run autoremove to take care of that. Change-Id: I6530d7444197ec763d3695020200c411aed545b4
22 lines
534 B
YAML
22 lines
534 B
YAML
---
|
|
- name: Remove cloud-init
|
|
package:
|
|
name: cloud-init
|
|
state: absent
|
|
|
|
- name: Get rid of cloud-init depends
|
|
command: apt-get autoremove -y
|
|
|
|
# Set hostname and /etc/hosts
|
|
# Inspired by:
|
|
# https://github.com/ansible/ansible/pull/8482)
|
|
# https://gist.github.com/rothgar/8793800
|
|
- name: Set /etc/hostname
|
|
hostname: name="{{ inventory_hostname.split('.', 1)[0] }}"
|
|
|
|
- name: Set /etc/hosts
|
|
template: src=hosts.j2 dest=/etc/hosts mode=0644
|
|
|
|
- name: Set /etc/mailname
|
|
template: src=mailname.j2 dest=/etc/mailname mode=0644
|