Changeset - e705dde5e6c7
[Not reviewed]
1 3 1
Branko Majic (branko) - 9 years ago 2015-04-27 20:02:08
branko@majic.rs
MAR-13: Updated the template for preesed files for Jessie. Moved the ansible_key configuration option out of testsite's bootstrap playbook in order to use it inside of preseed files as well.
4 files changed with 27 insertions and 5 deletions:
0 comments (0 inline, 0 general)
roles/preseed/tasks/main.yml
Show inline comments
 
@@ -4,6 +4,6 @@
 
  file: path="{{ preseed_directory }}" mode=750 state=directory
 

	
 
- name: Create preseed configuration file
 
  template: src="preseed-wheezy.cfg.j2" dest="{{ preseed_directory }}/{{ item.name }}.cfg"
 
  template: src="preseed-jessie.cfg.j2" dest="{{ preseed_directory }}/{{ item.name }}.cfg"
 
            mode=640
 
  with_items: preseed_servers
 
\ No newline at end of file
roles/preseed/templates/preseed-jessie.cfg.j2
Show inline comments
 
file renamed from roles/preseed/templates/preseed-wheezy.cfg.j2 to roles/preseed/templates/preseed-jessie.cfg.j2
 
@@ -15,7 +15,6 @@ d-i debian-installer/country string {{ item.country }}
 
d-i debian-installer/locale string {{ item.locale }}
 

	
 
# Keyboard layout.
 
d-i keymap select {{ item.keymap }}
 
d-i keyboard-configuration/xkb-keymap select {{ item.keymap }}
 

	
 

	
 
@@ -101,7 +100,29 @@ d-i partman/confirm_nooverwrite boolean true
 
# Install standard packages and SSH server.
 
tasksel tasksel/first multiselect standard,ssh-server
 

	
 

	
 
### Boot loader installation
 
# This is fairly safe to set, it makes grub install automatically to the MBR
 
# if no other operating system is detected on the machine.
 
d-i grub-installer/only_debian boolean true
 

	
 
# This one makes grub-installer install to the MBR if it also finds some other
 
# OS, which is less safe as it might not be able to boot that other OS.
 
d-i grub-installer/with_other_os boolean true
 

	
 
# Due notably to potential USB sticks, the location of the MBR can not be
 
# determined safely in general, so this needs to be specified:
 
#d-i grub-installer/bootdev  string /dev/sda
 

	
 
# To install to the first device (assuming it is not a USB stick):
 
d-i grub-installer/bootdev  string default
 

	
 

	
 
### Finishing up the installation
 

	
 
# Deploy the Ansible ssh key to root's authorized_keys
 
d-i preseed/late_command string mkdir -m 700 /target/root/.ssh/; echo "{{ ansible_key }}" > /target/root/.ssh/authorized_keys; chmod 600 /target/root/.ssh/authorized_keys
 

	
 
# Avoid that last message about the install being complete.
 
d-i finish-install/reboot_in_progress note
 

	
testsite/group_vars/all.yml
Show inline comments
 
---
 
# Configuration for roles bootstrap and preseed.
 
ansible_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
 

	
 
# Configuration for role 'common', shared across all servers.
 
os_users:
 
  - name: admin
testsite/playbooks/bootstrap.yml
Show inline comments
 
@@ -3,6 +3,4 @@
 
- hosts: "{{ server }}"
 
  remote_user: root
 
  roles:
 
    - bootstrap
 
  vars:
 
    ansible_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
 
\ No newline at end of file
 
    - bootstrap
 
\ No newline at end of file
0 comments (0 inline, 0 general)