-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHeadlessPi.yml
79 lines (71 loc) · 1.86 KB
/
HeadlessPi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
- hosts: zStart
vars:
newuser: <username>
newpassword : <password>
tasks:
- name: Ping the server.
ping:
- name: Make sure we have a 'wheel' group
group:
name: wheel
state: present
- name: Allow 'wheel' group to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'
- name: Add sudoers users to wheel group
user:
name='{{newuser}}'
groups=wheel
append=yes
state=present
createhome=yes
- name: Add new privileged user.
user:
name: "{{newuser}}"
password: "{{ newpassword | password_hash('sha512') }}"
group: wheel
groups: wheel
createhome: yes
append: yes
shell: /bin/bash
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: Create github directory
file:
path: /opt/github
state: directory
- name: install useful packages for network admin and home projects.
apt:
pkg:
- ubuntu-dev-tools
- build-essential
- net-tools
- clang-12 --install-suggests
- manpages-dev
- python3
- zlib1g-dev
- libncurses5-dev
- libgdbm-dev
- libnss3-dev
- libssl-dev
- libreadline-dev
- libffi-dev
- wget
- name: install Cisco Ansible Meraki Scripts.
git:
repo: 'https://github.com/CiscoDevNet/ansible-meraki.git'
dest: /opt/github/
clone: yes
update: no
- name: install Cisco vs-code for DevNet practice.
git:
repo: 'https://github.com/CiscoDevNet/vs-code-iox-client.git'
dest: /opt/github/
clone: yes
update: no