29 lines
583 B
YAML
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
|