forked from clayshek/raspi-ubuntu-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-data
98 lines (87 loc) · 3.26 KB
/
user-data
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#cloud-config
# This is the user-data configuration file for cloud-init. By default this sets
# up an initial user called "ubuntu" with password "ubuntu", which must be
# changed at first login. However, many additional actions can be initiated on
# first boot from this file. The cloud-init documentation has more details:
#
# https://cloudinit.readthedocs.io/
#
# Some additional examples are provided in comments below the default
# configuration.
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: rashome1
# On first boot, set the (default) ubuntu user's password to "ubuntu" and
# do not expire user passwords
#chpasswd:
# expire: false
# list:
# - ubuntu:ubuntu
# Enable password authentication with the SSH daemon
ssh_pwauth: true
## On first boot, use ssh-import-id to give the specific users SSH access to
## the default user
#ssh_import_id:
#- lp:my_launchpad_username
#- gh:my_github_username
## Add users and groups to the system, and import keys with the ssh-import-id
## utility
#groups:
#- robot: [robot]
#- robotics: [robot]
#- pi
#
users:
- name: ansible
primary-group: users
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
passwd: $5$JohOZuDSz8s4hrMS$WAmGo.fT8UTVLLExKKag1KEP9QAIn16KJCfcEEhfnWC
groups: users,adm,dialout,audio,plugdev,netdev,video
lock_passwd: true
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDtpAxHXoJaIxbbfkTZGh6IPqCfQyD7oBSwDxdocNmzxbMXbfqwML/CN7Rfp0icBC+fCL03LgcpmZ9nuF1Jvfjp90JhnXWD2hrnLjBrOaP4x6RlTSkFLSLxgJaLe6JTjb3pMJmkPgqpNhtC/T2SyfG8G5MRDnNItyn5vof2ZxanDO5rs2unNpr11LIFqa9s/UmjUQFOgeqWT8OZWY239abdMzh2OvY4gsDn5KCOHuzPdy8zcYeevLozInY4kNvywZtx+KkA0j6X9LHTO0Il7IzvPcdpw8VlqMK/mw3ENcE4aHfbmGyRKOSmamP5Wi0fCZqjXYnFQy+nyBIkz7Yi3IFQjUVuCuafIBvDmWUCuYiL3fmCH4R+KdNzE/Jes3zXABjcYF89fHRu2O99kKKjj53Un7SUdghtJrH9h4FJKOrZHgRqT4udJ2vOwxJB9qwW8Q0vqn/U79Ds80+H3updm40OUJB93LtMPpwqIKghuDsFaYO/J62zK38UBLZpUvKeCf8= ansible@rashome1
#- default
#- name: robot
# gecos: Mr. Robot
# primary_group: robot
# groups: users
# ssh_import_id: foobar
# lock_passwd: false
# passwd: $5$hkui88$nvZgIle31cNpryjRfO9uArF7DYiBcWEnjqq7L1AQNN3
## Update apt database and upgrade packages on first boot
# package_update: true
# package_upgrade: true
## Install additional packages on first boot
packages:
- avahi-daemon
- ansible
#- pastebinit
#- [libpython2.7, 2.7.3-0ubuntu3.1]
## Write arbitrary files to the file-system (including binaries!)
#write_files:
#- path: /etc/default/keyboard
# content: |
# # KEYBOARD configuration file
# # Consult the keyboard(5) manual page.
# XKBMODEL="pc105"
# XKBLAYOUT="gb"
# XKBVARIANT=""
# XKBOPTIONS="ctrl: nocaps"
# permissions: '0644'
# owner: root:root
#- encoding: gzip
# path: /usr/bin/hello
# content: !!binary |
# H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
# owner: root:root
# permissions: '0755'
## Run arbitrary commands at rc.local like time
runcmd:
# Pickup the hostname changes
- 'sudo systemctl restart avahi-daemon'
- 'sudo ansible-pull -U https://github.com/clayshek/raspi-ubuntu-ansible.git -i inventory.yml provision.yml > /var/log/ansible-provision.run 2>&1'
#- [ sh, -xc, "echo $(date) ': hello world!'" ]
#- [ wget, "http://ubuntu.com", -O, /run/mydir/index.html ]
powerstate:
delay: "+5"
mode: reboot