-numerous changes to work with Raspbian 10

-redo of some roles, particularly GUI
-modifications to support working from a "Raspbian Lite" install
This commit is contained in:
mpelle426
2019-07-10 14:24:34 +01:00
parent f86279f3cc
commit ed7eabd399
61 changed files with 12386 additions and 12383 deletions

147
roles/common/tasks/main.yaml Executable file → Normal file
View File

@@ -1,68 +1,79 @@
---
- name: Upgrade all packages to the latest version
become: true
apt:
upgrade: yes
update_cache: yes
tags: apt_upgrade
- name: Create directories
file:
path: "{{ item }}"
state: directory
owner: pi
group: pi
with_items:
- /home/pi/Documents/ftp
- /home/pi/Documents/smb
- /home/pi/scripts
tags: create_dirs
- name: update hosts file
become: true
blockinfile:
dest: /etc/hosts
content: "{{ lookup('template', '{{ role_path }}/templates/hosts.j2') }}"
state: present
tags: update_hosts
- name: clean hosts file
become: true
blockinfile:
path: /etc/hosts
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: ""
tags: clean_hosts
- name: install programs and libraries
become: true
apt:
name: [ 'expect', 'ftp', 'cadaver', 'iperf', 'iperf3', 'libpcap0.8', 'libsctp1', 'libsctp-dev', 'libncurses-dev', 'libssl-dev', 'libpcap-dev', 'vim', 'mc', 'smbclient', 'ncurses-dev', 'build-essential', 'openvpn' ]
update_cache: true
state: present
tags: install_packages
- name: set hostname
become: true
hostname:
name: '{{ inventory_hostname }}'
tags: set_hostname
- name: enable openvpn
become: true
service:
name: openvpn
enabled: yes
tags: enable_openvpn
register: openvpn_enabled
- name: enable openvpn config
become: true
lineinfile:
path: /etc/default/openvpn
state: present
regexp: '^#AUTOSTART="all"'
line: 'AUTOSTART="all"'
tags: enable_openvpn
- name: start openvpn
become: true
systemd:
daemon_reload: yes
name: openvpn
state: restarted
tags: enable_openvpn
when: openvpn_enabled
---
- name: Upgrade all packages to the latest version
become: true
apt:
upgrade: yes
update_cache: yes
tags: apt_upgrade
- name: Create directories
file:
path: "{{ item }}"
state: directory
owner: pi
group: pi
with_items:
- /home/pi/Documents/ftp
- /home/pi/Documents/smb
- /home/pi/scripts
tags: create_dirs
- name: update hosts file
become: true
blockinfile:
dest: /etc/hosts
content: "{{ lookup('template', '{{ role_path }}/templates/hosts.j2') }}"
state: present
tags: update_hosts
- name: install programs and libraries
become: true
apt:
name: [ 'expect', 'ftp', 'cadaver', 'iperf', 'iperf3', 'libpcap0.8', 'libsctp1', 'libsctp-dev', 'libncurses-dev', 'libssl-dev', 'libpcap-dev', 'vim', 'mc', 'smbclient', 'ncurses-dev', 'build-essential', 'openvpn', 'lightdm', 'lxde', 'realvnc-vnc-server', 'aptitude', 'chromium-browser', 'raspberrypi-ui-mods' ]
update_cache: true
state: present
tags: install_packages
- name: set hostname
become: true
hostname:
name: '{{ inventory_hostname }}'
tags: set_hostname
- name: enable openvpn
become: true
service:
name: openvpn
enabled: yes
tags: enable_openvpn
register: openvpn_enabled
- name: enable openvpn config
become: true
lineinfile:
path: /etc/default/openvpn
state: present
regexp: '^#AUTOSTART="all"'
line: 'AUTOSTART="all"'
tags: enable_openvpn
- name: start openvpn
become: true
systemd:
daemon_reload: yes
name: openvpn
state: restarted
tags: enable_openvpn
when: openvpn_enabled
- lineinfile:
path: /etc/sudoers
state: present
regexp: '^%sudo'
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'
become: true
tags: pi_sudo
- name: Ensure the locale exists
locale_gen:
name: en_US.UTF-8
state: present
become: yes
- name: set as default locale
command: raspi-config nonint do_change_locale en_US.UTF-8
become: yes
- name: set keyboard to us
command: raspi-config nonint do_configure_keyboard us

View File

@@ -1,7 +1,7 @@
{% for item in ansible_play_batch %}
{{ hostvars[item].ansible_host }} {{ item }}.demo.dsfinancial.com
{% endfor %}
{% for item in ansible_play_batch %}
{{ hostvars[item].ansible_host }} {{ item }}
{% endfor %}
{% for item in ansible_play_batch %}
{{ hostvars[item].ansible_host }} {{ item }}.demo.dsfinancial.com
{% endfor %}
{% for item in ansible_play_batch %}
{{ hostvars[item].ansible_host }} {{ item }}
{% endfor %}