Initial commit
[ta/infra-ansible.git] / roles / baremetal_provision / templates / user_data.j2
1 Content-Type: multipart/mixed; boundary="===============9156907225490855809=="
2 MIME-Version: 1.0
3
4 --===============9156907225490855809==
5 Content-Type: text/plain; charset="us-ascii"
6 MIME-Version: 1.0
7 Content-Transfer-Encoding: 7bit
8 Content-Disposition: attachment; filename
9
10 #cloud-config
11 disable_root: 0
12 ssh_pwauth: 1
13 cloud_init_modules: [migrator, bootcmd, write-files, update_etc_hosts, rsyslog, users-groups, ssh]
14 preserve_hostname: true
15 manage-resolv-conf: false
16 users:
17   - name: "{{users.admin_user_name}}"
18     sudo: ['ALL=(ALL) NOPASSWD:ALL']
19     ssh-authorized-keys:
20       - "{{ lookup('file', ansible_env.PWD + '/.ssh/id_rsa.pub') }}"
21     passwd: {{users.admin_user_password}}
22     lock_passwd: False
23
24 --===============9156907225490855809==
25 Content-Type: text/cloud-boothook; charset="us-ascii"
26 MIME-Version: 1.0
27 Content-Transfer-Encoding: 7bit
28 Content-Disposition: attachment; filename="boothook.sh"
29
30 #!/bin/bash
31 mkdir -p /etc/os-net-config/
32 echo '{{lookup('file', '/tmp/'+item[0].name+'_config.yaml')}}' > /etc/os-net-config/config.yaml
33 /usr/bin/os-net-config
34 --===============9156907225490855809==--