Add Ansible template
This commit is contained in:
parent
1115e86296
commit
fa1a1138d6
22 changed files with 699 additions and 3 deletions
46
roles/tftp/tasks/main.yml
Normal file
46
roles/tftp/tasks/main.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
- name: Fail if firmware files are missing
|
||||
ansible.builtin.stat:
|
||||
path: "roles/tftp/files/firmware/{{ item }}"
|
||||
register: firmware_stat
|
||||
loop: "{{ firmware_files }}"
|
||||
failed_when: not firmware_stat.stat.exists
|
||||
|
||||
- name: Install TFTP server
|
||||
ansible.builtin.package:
|
||||
name: tftpd-hpa
|
||||
state: present
|
||||
|
||||
- name: Enable and start TFTP service
|
||||
ansible.builtin.service:
|
||||
name: tftpd-hpa
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Configure TFTP server
|
||||
ansible.builtin.template:
|
||||
src: tftpd-hpa.j2
|
||||
dest: /etc/default/tftpd-hpa
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: Restart TFTP
|
||||
|
||||
- name: Upload SEPMAC configuration files
|
||||
ansible.builtin.template:
|
||||
src: SEPMAC.cnf.xml.j2
|
||||
dest: "{{ tftp_root_dir }}/{{ item.mac }}.cnf.xml"
|
||||
mode: '0644'
|
||||
loop: "{{ extensions }}"
|
||||
|
||||
- name: Upload firmware files
|
||||
ansible.builtin.copy:
|
||||
src: "firmware/{{ item }}"
|
||||
dest: "{{ tftp_root_dir }}/{{ item }}"
|
||||
mode: '0644'
|
||||
loop: "{{ firmware_files }}"
|
||||
|
||||
- name: Upload dialplan file
|
||||
ansible.builtin.copy:
|
||||
src: "dialplan.xml"
|
||||
dest: "{{ tftp_root_dir }}/dialplan.xml"
|
||||
mode: '0644'
|
Loading…
Add table
Add a link
Reference in a new issue