aboutsummaryrefslogblamecommitdiffstats
path: root/roles/space_server/tasks/networkd.yml
blob: 0059ed648811f4f6364f2ab9d1dd96d2e9469fa7 (plain) (tree)
1
2
3
4
5
6
7
8




                                  


               





                                               

                         
                                 
                     


               
                            







                                                                        
 



                                                                      


               

                                                            
                                                                                      
                                 


               
 
                        
---
- name: Make sure directory exists
  file:
    dest: '/etc/systemd/network'
    state: directory
    owner: root
    group: root
    mode: 0755

- name: Register existing network configuration
  find:
    paths: '/etc/systemd/network'
  register: networkd_existing

- name: Configure network
  copy:
    dest: '/etc/systemd/network/'
    src: '{{ item }}'
    owner: root
    group: root
    mode: 0644
  with_fileglob: 'network/*'
  register: networkd_created

- name: Delete unneeded network configuration
  file:
    path: '{{ item }}'
    state: absent
  with_items: "{{ networkd_existing.files|map(attribute='path')|list }}"
  when: "item not in networkd_created.results|map(attribute='dest')"

- name: Create systemd-networkd-wait-online drop-in directory
  file:
    dest: '/etc/systemd/system/systemd-networkd-wait-online.service.d'
    state: directory
    owner: root
    group: root
    mode: 0755
- name: Don't wait for lan and mgt interfaces to come online
  copy:
    dest: '/etc/systemd/system/systemd-networkd-wait-online.service.d/no-lan-mgt.conf'
    src: networkd-no-lan-mgt.conf
    owner: root
    group: root
    mode: 0644

# vim: set ts=2 sw=2 et: