init commit
This commit is contained in:
37
tasks/main.yaml
Normal file
37
tasks/main.yaml
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
|
||||
- name: Check for pi user
|
||||
shell: "getent passwd | grep pi"
|
||||
register: pi_user_output
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set pi_user_exists
|
||||
set_fact:
|
||||
pi_user_exists: "{{ not pi_user_output.failed | bool }}"
|
||||
|
||||
- name: Create pi user
|
||||
when: not pi_user_exists | bool
|
||||
user:
|
||||
name: "pi"
|
||||
password: "{{ pi_default_password | password_hash('sha512') }}"
|
||||
shell: /bin/bash
|
||||
|
||||
- name: Check for pi-top platform
|
||||
shell: pi-top --help
|
||||
register: pitop_output
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set deb_base
|
||||
set_fact:
|
||||
deb_base: true
|
||||
when: pitop_output.failed
|
||||
ignore_errors: true
|
||||
|
||||
- name: Onboard if base debian
|
||||
include_tasks: onboard.yaml
|
||||
when: deb_base
|
||||
|
||||
- name: Install the requested project
|
||||
include_tasks: "{{ function }}.yaml"
|
||||
|
||||
...
|
||||
Reference in New Issue
Block a user