--- - hosts: all name: Init tasks: - name: Check system compatibility when: ansible_distribution != "CentOS" and ansible_distribution != "Red Hat Enterprise Linux" and ansible_distribution != "Fedora" meta: end_play debug: msg: "Standard configuration deployment is only supported on Fedora 27/28, Centos 7.5, and RHEL" - name: Set hostname become: true hostname: name: "{{ default_host if default_host is defined else inventory_hostname }}" - name: Install MOTD become: true template: src: motd.j2 dest: /etc/motd mode: 0644 - name: Install global bashrc become: true template: src: bashrc.j2 dest: /etc/profile.d/30-omni-bashrc.sh mode: 0644 - hosts: all name: System packages tasks: - import_tasks: common/centos/repositories.yml when: ansible_distribution == "CentOS" - import_tasks: common/centos/packages.yml when: ansible_distribution == "CentOS" - import_tasks: common/fedora/packages.yml when: ansible_distribution == "Fedora" # - import_tasks: common/debian/packages.yml # when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu" - import_playbook: update-system.yml - hosts: all name: Replace NetworkManager with systemd-networkd tasks: - name: Install systemd-networkd when: enable_networkd == true block: - import_tasks: common/centos/networkd.yml when: ansible_distribution == "CentOS" - import_tasks: common/fedora/networkd.yml when: ansible_distribution == "Fedora" # - import_tasks: common/debian/networkd.yml # when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu" - name: Configure systemd-networkd when: enable_networkd == true - import_tasks: common/networkd.yml - hosts: all name: Register static DHCP entries tasks: - name: Install static DHCP leases delegate_to: {{ router.address }} when: networking is defined edgeos_config: save: true lines: - set service dhcp-server shared-network-name {{ router.static.server }} subnet {{ router.static.subnet }} static-mapping {{ item.alias | default(inventory_hostname) }} mac-address {{ item.mac }} - set service dhcp-server shared-network-name {{ router.static.server }} subnet {{ router.static.subnet }} static-mapping {{ item.alias | default(inventory_hostname) }} ip-address {{ item.address }} with_dict: "{{ networking }}"