1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| --- - hosts: localhost name: lldpd installation vars: lldpd_version: 1.0.5 tasks: - name: Retrieve lldpd source code get_url: url: https://media.luffy.cx/files/lldpd/lldpd-{{ lldpd_version }}.tar.gz dest: /tmp/lldpd-{{ lldpd_version }}.tar.gz - name: Extract archive unarchive: src: /tmp/lldpd-{{ lldpd_version }}.tar.gz dest: /tmp - name: Configure install command: ./configure args: chdir: /tmp/lldpd-{{ lldpd_version }} creates: /tmp/lldpd-{{ lldpd_version }}/configure.status.log - name: Build lldpd command: make args: chdir: /tmp/lldpd-{{ lldpd_version }} creates: /tmp/lldpd-{{ lldpd_version }}/make.status.log - name: Install lldpd become: true command: make install args: chdir: /tmp/lldpd-{{ lldpd_version }} creates: /tmp/lldpd-{{ lldpd_version }}/make_install.status.log - name: Create chroot for lldpd file: path: /usr/local/var/run/lldpd state: directory - name: Create _lldpd group group: name: _lldpd state: present - name: Create _lldpd user user: name: _lldpd group: _lldpd comment: lldpd user - name: Remove build directory file: path: /tmp/lldpd-{{ lldpd_version }} state: absent - name: Remove archive file: path: /tmp/lldpd-{{ lldpd_version }}.tar.gz state: absent - name: Enable lldpd service systemd: name: lldpd enabled: true masked: false - name: Start lldpd service systemd: name: lldpd state: started
|