Ansible_PUBLIC/roles/lldp/tasks/main.yml
2020-03-13 20:05:35 +01:00

29 lines
583 B
YAML

- name: Install lldpd
apt:
pkg:
- lldpd
- name: stop transmission
systemd:
state: stopped
name: lldpd
- name: memorize hostname variable
shell: hostname
register: hostname
- set_fact:
hostname={{ hostname.stdout }}
- name: Add a line to a file if the file does not exist, without passing regexp
lineinfile:
# path: /etc/lldpd.d/hostname.conf
destfile: /etc/lldpd.d/hostname.conf
line: configure system description {{ hostname }}
create: yes
state: present
- name: stop transmission
systemd:
state: started
name: lldpd