various updates
This commit is contained in:
@@ -15,19 +15,54 @@
|
||||
path: /etc/motd
|
||||
state: absent
|
||||
|
||||
- name: Detect Armbian
|
||||
ansible.builtin.stat:
|
||||
path: /etc/armbian-release
|
||||
register: armbian
|
||||
- name: Set facts about platform
|
||||
ansible.builtin.set_fact:
|
||||
is_orangepi: false
|
||||
is_rockpi: false
|
||||
|
||||
- name: Add custom /etc/motd for Armbian
|
||||
- name: Try to detect Orange Pi
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/armbian-release
|
||||
regex: 'orange'
|
||||
state: absent
|
||||
changed_when: false
|
||||
register: orangepi_armbian
|
||||
|
||||
- name: Set fact about Orange Pi
|
||||
ansible.builtin.set_fact:
|
||||
is_orangepi: true
|
||||
when: 'orangepi_armbian.found == 1'
|
||||
|
||||
- name: Try to detect Rock Pi
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/armbian-release
|
||||
regex: 'rockpi'
|
||||
state: absent
|
||||
changed_when: false
|
||||
register: rockpi_armbian
|
||||
|
||||
- name: Set fact about Rock Pi
|
||||
ansible.builtin.set_fact:
|
||||
is_rockpi: true
|
||||
when: 'rockpi_armbian.found == 1'
|
||||
|
||||
- name: Add custom /etc/motd for Orange Pi
|
||||
ansible.builtin.copy:
|
||||
src: motd.orangepi
|
||||
dest: /etc/motd
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
when: armbian.stat.exists == True
|
||||
when: is_orangepi == True
|
||||
|
||||
- name: Add custom /etc/motd for Rock Pi
|
||||
ansible.builtin.copy:
|
||||
src: motd.radxa
|
||||
dest: /etc/motd
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
when: is_rockpi == True
|
||||
|
||||
- name: Add common custom /etc/motd
|
||||
ansible.builtin.copy:
|
||||
@@ -36,4 +71,4 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
when: armbian.stat.exists == False
|
||||
when: 'is_orangepi == False and is_rockpi == False'
|
||||
|
||||
Reference in New Issue
Block a user