kameleon-builder 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/.editorconfig +0 -0
  2. data/.env +63 -15
  3. data/.gitignore +1 -0
  4. data/README.rst +4 -2
  5. data/Vagrantfile +13 -52
  6. data/bin/kameleon +5 -0
  7. data/completion/_kameleon.zsh +18 -0
  8. data/completion/kameleon.bash +13 -0
  9. data/completion/kameleon.fish +10 -0
  10. data/contrib/polipo_env.sh +2 -0
  11. data/contrib/steps/export/save_as_g5k.yaml +63 -0
  12. data/contrib/steps/setup/add_to_sudoers.yaml +5 -0
  13. data/docs/Makefile +10 -6
  14. data/docs/README.md +17 -0
  15. data/docs/source/_static/kameleon-logo.png +0 -0
  16. data/docs/source/_static/kameleon-logo.xcf +0 -0
  17. data/docs/source/_static/kameleon-long.png +0 -0
  18. data/docs/source/aliases.rst +4 -2
  19. data/docs/source/checkpoint.rst +2 -0
  20. data/docs/source/commands.rst +4 -3
  21. data/docs/source/conf.py +15 -7
  22. data/docs/source/context.rst +7 -4
  23. data/docs/source/faq.rst +39 -1
  24. data/docs/source/getting_started.rst +227 -1
  25. data/docs/source/grid5000_tutorial.rst +110 -0
  26. data/docs/source/index.rst +7 -2
  27. data/docs/source/installation.rst +12 -4
  28. data/docs/source/persistent_cache.rst +34 -0
  29. data/docs/source/recipe.rst +23 -16
  30. data/docs/source/use_cases.rst +93 -0
  31. data/docs/source/workspace.rst +2 -0
  32. data/kameleon-builder.gemspec +7 -1
  33. data/lib/kameleon.rb +3 -6
  34. data/lib/kameleon/cli.rb +104 -50
  35. data/lib/kameleon/compat.rb +39 -0
  36. data/lib/kameleon/context.rb +43 -13
  37. data/lib/kameleon/engine.rb +118 -77
  38. data/lib/kameleon/environment.rb +3 -5
  39. data/lib/kameleon/error.rb +15 -9
  40. data/lib/kameleon/logger.rb +7 -4
  41. data/lib/kameleon/persistent_cache.rb +139 -0
  42. data/lib/kameleon/recipe.rb +200 -81
  43. data/lib/kameleon/shell.rb +51 -16
  44. data/omnibus/.gitignore +11 -0
  45. data/omnibus/.kitchen.yml +25 -0
  46. data/omnibus/Berksfile +9 -0
  47. data/omnibus/Berksfile.lock +25 -0
  48. data/omnibus/Gemfile +12 -0
  49. data/omnibus/README.md +94 -0
  50. data/omnibus/config/projects/kameleon.rb +23 -0
  51. data/omnibus/config/software/kameleon.rb +24 -0
  52. data/omnibus/config/software/polipo.rb +30 -0
  53. data/omnibus/config/software/ruby.rb +158 -0
  54. data/omnibus/files/mac_dmg/Resources/background.png +0 -0
  55. data/omnibus/files/mac_dmg/Resources/icon.png +0 -0
  56. data/omnibus/files/mac_pkg/Resources/background.png +0 -0
  57. data/omnibus/files/mac_pkg/Resources/license.html +1 -0
  58. data/omnibus/files/mac_pkg/Resources/welcome.html +9 -0
  59. data/omnibus/omnibus.rb +27 -0
  60. data/omnibus/package-scripts/kameleon/makeselfinst +27 -0
  61. data/omnibus/package-scripts/kameleon/postrm +9 -0
  62. data/templates/archlinux-desktop.yaml +25 -0
  63. data/templates/archlinux.yaml +106 -0
  64. data/templates/debian-testing.yaml +25 -0
  65. data/templates/debian7-desktop.yaml +25 -0
  66. data/templates/{debian-wheezy-docker.yaml → debian7-docker.yaml} +30 -16
  67. data/templates/debian7-g5k.yaml +97 -0
  68. data/templates/debian7-oar-dev.yaml +51 -0
  69. data/templates/debian7.yaml +128 -0
  70. data/templates/extend.erb +23 -0
  71. data/templates/fedora-rawhide.yaml +30 -0
  72. data/templates/fedora20-desktop.yaml +21 -0
  73. data/templates/fedora20.yaml +105 -0
  74. data/templates/{debian-wheezy-chroot.yaml → old-debian7.yaml} +51 -38
  75. data/templates/{aliases → steps/aliases}/defaults.yaml +37 -12
  76. data/templates/steps/bootstrap/archlinux/arch_bootstrap.yaml +219 -0
  77. data/templates/steps/bootstrap/archlinux/install_bootloader.yaml +46 -0
  78. data/templates/steps/bootstrap/archlinux/populate_disk.yaml +39 -0
  79. data/templates/steps/bootstrap/debian/debootstrap.yaml +18 -10
  80. data/templates/steps/bootstrap/debian/debootstrap_arm.yaml +31 -0
  81. data/templates/steps/bootstrap/fedora/liveos_bootstrap.yaml +123 -0
  82. data/templates/steps/bootstrap/g5k_reserv.yaml +70 -0
  83. data/templates/steps/bootstrap/initialize_disk_chroot.yaml +84 -0
  84. data/templates/steps/bootstrap/initialize_disk_qemu.yaml +72 -0
  85. data/templates/steps/bootstrap/install_bootloader.yaml +42 -0
  86. data/templates/steps/bootstrap/prepare_chroot.yaml +126 -0
  87. data/templates/steps/bootstrap/prepare_docker.yaml +19 -8
  88. data/templates/steps/bootstrap/prepare_qemu.yaml +47 -0
  89. data/templates/steps/bootstrap/start_chroot.yaml +11 -2
  90. data/templates/steps/bootstrap/start_docker.yaml +2 -2
  91. data/templates/steps/bootstrap/start_qemu.yaml +75 -0
  92. data/templates/steps/bootstrap/ubuntu/debootstrap.yaml +27 -0
  93. data/templates/steps/breakpoint.yaml +2 -0
  94. data/templates/{checkpoints → steps/checkpoints}/docker.yaml +0 -0
  95. data/templates/steps/checkpoints/qcow2.yaml +38 -0
  96. data/templates/steps/checkpoints/qemu.yaml +39 -0
  97. data/templates/steps/export/clean_appliance.yaml +7 -1
  98. data/templates/steps/export/compact_qcow_img.yaml +12 -0
  99. data/templates/steps/export/save_appliance.yaml +58 -0
  100. data/templates/steps/export/save_appliance_from_g5k.yaml +47 -0
  101. data/templates/steps/export/save_vagrant_box.yaml +29 -0
  102. data/templates/steps/setup/archlinux/configure_keyboard.yaml +9 -0
  103. data/templates/steps/setup/archlinux/configure_network.yaml +9 -0
  104. data/templates/steps/setup/archlinux/configure_ruby.yaml +7 -0
  105. data/templates/steps/setup/archlinux/configure_system.yaml +20 -0
  106. data/templates/steps/setup/archlinux/install_dev_tools.yaml +18 -0
  107. data/templates/steps/setup/archlinux/install_gnome.yaml +27 -0
  108. data/templates/steps/setup/archlinux/install_software.yaml +9 -0
  109. data/templates/steps/setup/archlinux/install_yaourt.yaml +29 -0
  110. data/templates/steps/setup/autologin.yaml +16 -0
  111. data/templates/steps/setup/create_group.yaml +12 -0
  112. data/templates/steps/setup/create_user.yaml +9 -10
  113. data/templates/steps/setup/debian/configure_apt.yaml +65 -0
  114. data/templates/steps/setup/debian/configure_kernel.yaml +18 -0
  115. data/templates/steps/setup/debian/{keyboard_config.yaml → configure_keyboard.yaml} +1 -1
  116. data/templates/steps/setup/debian/{network_config.yaml → configure_network.yaml} +0 -0
  117. data/templates/steps/setup/debian/{system_config.yaml → configure_system.yaml} +0 -0
  118. data/templates/steps/setup/debian/install_gnome.yaml +13 -0
  119. data/templates/steps/setup/debian/install_kde.yaml +13 -0
  120. data/templates/steps/setup/debian/install_software.yaml +2 -0
  121. data/templates/steps/setup/debian/oar/oar_debian_config_frontend.yaml +8 -0
  122. data/templates/steps/setup/debian/oar/oar_debian_config_node.yaml +5 -0
  123. data/templates/steps/setup/debian/oar/oar_debian_config_server.yaml +5 -0
  124. data/templates/steps/setup/debian/oar/oar_prereq_install.yaml +16 -0
  125. data/templates/steps/setup/debian/setup_vagrant_box.yaml +52 -0
  126. data/templates/steps/setup/debian/upgrade_system.yaml +15 -0
  127. data/templates/steps/setup/fedora/configure_network.yaml +30 -0
  128. data/templates/steps/setup/fedora/configure_system.yaml +59 -0
  129. data/templates/steps/setup/fedora/install_software.yaml +3 -0
  130. data/templates/steps/setup/fedora/update_system.yaml +10 -0
  131. data/templates/steps/setup/oar/oar_config_devel.yaml +21 -0
  132. data/templates/steps/setup/oar/oar_config_frontend.yaml +38 -0
  133. data/templates/steps/setup/oar/oar_config_node.yaml +4 -0
  134. data/templates/steps/setup/oar/oar_config_server.yaml +25 -0
  135. data/templates/steps/setup/oar/oar_config_system.yaml +34 -0
  136. data/templates/steps/setup/oar/oar_devel_prereq_install.yaml +5 -0
  137. data/templates/steps/setup/oar/oar_git_install.yaml +21 -0
  138. data/templates/steps/setup/ubuntu/configure_apt.yaml +67 -0
  139. data/templates/ubuntu-12.04-desktop.yaml +25 -0
  140. data/templates/ubuntu-12.04.yaml +128 -0
  141. data/templates/ubuntu-14.04-desktop.yaml +27 -0
  142. data/templates/ubuntu-14.04.yaml +25 -0
  143. data/templates/vagrant-debian7.yaml +31 -0
  144. data/version.txt +1 -1
  145. metadata +155 -28
  146. checksums.yaml +0 -7
  147. data/templates/checkpoints/qcow2.yaml +0 -44
  148. data/templates/fedora-docker.yaml +0 -96
  149. data/templates/steps/bootstrap/fedora/docker_bootstrap.yaml +0 -25
  150. data/templates/steps/bootstrap/fedora/yum_bootstrap.yaml +0 -22
  151. data/templates/steps/bootstrap/prepare_appliance_with_nbd.yaml +0 -93
  152. data/templates/steps/export/build_appliance_from_docker.yaml +0 -105
  153. data/templates/steps/export/save_appliance_from_nbd.yaml +0 -54
  154. data/templates/steps/setup/debian/kernel_install.yaml +0 -20
  155. data/templates/steps/setup/debian/software_install.yaml +0 -15
  156. data/templates/steps/setup/fedora/kernel_install.yaml +0 -27
  157. data/templates/steps/setup/fedora/software_install.yaml +0 -10
@@ -0,0 +1 @@
1
+ All Rights Reserved
@@ -0,0 +1,9 @@
1
+ This will install kameleon on your Mac.
2
+
3
+ --------------------------------------------------
4
+
5
+ This is a basic welcome message that is generated for every Omnibus project. You should customize this message by editing the file at files/mac_pkg/welcome.html.
6
+
7
+ If you are not the developer of kameleon, the presence of this message is likely a bug and should be reported to the creator.
8
+
9
+ Thank you for choosing Omnibus! Have a fantastic day!
@@ -0,0 +1,27 @@
1
+ #
2
+ # This file is used to configure the kameleon project. It contains
3
+ # come minimal configuration examples for working with Omnibus. For a full list
4
+ # of configurable options, please see the documentation for +omnibus/config.rb+.
5
+ #
6
+
7
+ # Build internally
8
+ # ------------------------------
9
+ # By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and
10
+ # cache compontents. If you would to build everything internally, you can
11
+ # uncomment the following options. This will prevent the need for root
12
+ # permissions in most cases. You will also need to update the kameleon
13
+ # project configuration to build at +./local/omnibus/build+ instead of
14
+ # +/opt/kameleon+
15
+ #
16
+
17
+ cache_dir '/var/cache/omnibus/cache'
18
+ install_path_cache_dir '/var/cache/omnibus/cache/install_path'
19
+ source_dir '/var/cache/omnibus/src'
20
+ build_dir '/var/cache/omnibus/build'
21
+ package_dir '/var/cache/omnibus/pkg'
22
+ package_tmp '/var/cache/omnibus/pkg-tmp'
23
+
24
+ # Customize compiler bits
25
+ # ------------------------------
26
+ # solaris_compiler 'gcc'
27
+ # build_retries 5
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+ #
3
+ # Install a full kameleon
4
+ #
5
+
6
+ PROGNAME=`basename $0`
7
+ INSTALLER_DIR=`dirname $0`
8
+ DEST_DIR=/opt/kameleon
9
+ CONFIG_DIR=/etc/kameleon
10
+ USAGE="usage: $0"
11
+
12
+ error_exit()
13
+ {
14
+ echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
15
+ exit 1
16
+ }
17
+
18
+ # move the actual files into place
19
+ rm -rf $DEST_DIR/* || error_exit "Cannot remove contents of $DEST_DIR"
20
+ mkdir -p $DEST_DIR || error_exit "Cannot create $DEST_DIR"
21
+ cp -R $INSTALLER_DIR $DEST_DIR || error_exit "Cannot install to $DEST_DIR"
22
+ rm -f $DEST_DIR/$PROGNAME
23
+
24
+ # You may want to symlink your packages bin files into /usr/bin
25
+ ln -sf $DEST_DIR/bin/kameleon /usr/bin || error_exit "Cannot link kameleon to /usr/bin"
26
+
27
+ exit 0
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ #
3
+ # Perform necessary kameleon removal steps
4
+ # after package is uninstalled.
5
+ #
6
+
7
+ echo "kameleon has been uninstalled!"
8
+
9
+ exit 0
@@ -0,0 +1,25 @@
1
+ #==============================================================================
2
+ # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
+ #==============================================================================
4
+ #
5
+ # DESCRIPTION: Archlinux GNOME Desktop edition.
6
+ #
7
+ #==============================================================================
8
+
9
+ ---
10
+ extend: archlinux
11
+
12
+ bootstrap:
13
+ - @base
14
+
15
+ setup:
16
+ - @base
17
+ - install_yaourt
18
+ - install_gnome:
19
+ - keyboard_layout: en
20
+ - extra_packages: >
21
+ firefox-i18n-en-us flashplugin libreoffice libreoffice-en-US telepathy
22
+ hunspell-en faenza-icon-theme file-roller
23
+
24
+ export:
25
+ - @base
@@ -0,0 +1,106 @@
1
+ #==============================================================================
2
+ # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
+ #==============================================================================
4
+ #
5
+ # DESCRIPTION: Build an Archlinux base system system.
6
+ #
7
+ #==============================================================================
8
+
9
+ ---
10
+ # Loads some helpful aliases
11
+ aliases: defaults.yaml
12
+ # Enables qcow2 checkpoint
13
+ checkpoint: qemu.yaml
14
+ #== Global variables use by Kameleon engine and the steps
15
+ global:
16
+ ## User varibales : used by the recipe
17
+ user_name: kameleon
18
+ user_password: $$user_name
19
+
20
+ # Distribution
21
+ distrib: archlinux
22
+ arch: x86_64
23
+
24
+ ## Disk options
25
+ nbd_device: /dev/nbd1
26
+ image_disk: $$kameleon_cwd/base_$$kameleon_recipe_name.qcow2
27
+ image_size: 10G
28
+ filesystem_type: ext4
29
+
30
+ ## QEMU options
31
+ qemu_enable_kvm: true
32
+ qemu_cpu: 2
33
+ qemu_memory_size: 512
34
+ qemu_monitor_port: 10023
35
+ qemu_ssh_port: 55423
36
+ qemu_arch: x86_64
37
+
38
+ # rootfs options
39
+ rootfs: $$kameleon_cwd/rootfs
40
+ rootfs_download_path: /var/cache/kameleon/$$distrib/$$arch/rootfs
41
+
42
+ ## System variables. Required by kameleon engine
43
+ # Include specific steps
44
+ include_steps:
45
+ - $$distrib
46
+
47
+ # Shell session from where we launch exec_out commands. There is often a
48
+ # local bash session, but it can be a remote shell on other machines or on
49
+ # any shell. (eg. bash, chroot, fakechroot, ssh, tmux, lxc...)
50
+ out_context:
51
+ cmd: bash
52
+ workdir: $$kameleon_cwd
53
+
54
+ # Shell session that allows us to connect to the building machine in order to
55
+ # configure it and setup additional programs
56
+ ssh_config_file: $$kameleon_cwd/ssh_config
57
+ in_context:
58
+ cmd: LC_ALL=POSIX ssh -F $$ssh_config_file $$kameleon_recipe_name -t /bin/bash
59
+ workdir: /root/kameleon_workdir
60
+
61
+
62
+ #== Bootstrap the new system and create the 'in_context'
63
+ bootstrap:
64
+ - arch_bootstrap:
65
+ - mirror: http://mir.archlinux.fr/
66
+ # You can choose any group from https://www.archlinux.org/groups/
67
+ # It's recommended to use 'base' (default) or 'base-devel' (with dev tools)
68
+ - pkg_group: base
69
+ - initialize_disk_qemu
70
+ - prepare_qemu
71
+ - install_bootloader
72
+ - start_qemu
73
+
74
+ #== Install and configuration steps
75
+ # WARNING: this part should be independante from the out context (whenever
76
+ # possible...)
77
+ setup:
78
+ # Install
79
+ - install_software:
80
+ - packages: ntp zip unzip rsync sudo vim bash-completion
81
+ # Configuration
82
+ - configure_system:
83
+ - locales: POSIX C en_US fr_FR de_DE
84
+ - lang: en_US.UTF-8
85
+ - timezone: UTC
86
+ - configure_keyboard:
87
+ # set to french keyboard use 'localectl list-keymaps' to see available list
88
+ - layout: en
89
+ - configure_network:
90
+ - hostname: kameleon-$$distrib
91
+ - create_user:
92
+ - name: $$user_name
93
+ - groups: wheel
94
+ - password: $$user_name
95
+
96
+ #== Export the generated appliance in the format of your choice
97
+ export:
98
+ - save_appliance:
99
+ - input: $$image_disk
100
+ - output: $$kameleon_cwd/$$kameleon_recipe_name
101
+ - save_as_qcow2
102
+ #- save_as_qed
103
+ # - save_as_tgz
104
+ # - save_as_raw
105
+ # - save_as_vmdk
106
+ # - save_as_vdi
@@ -0,0 +1,25 @@
1
+ #==============================================================================
2
+ # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
+ #==============================================================================
4
+ #
5
+ # DESCRIPTION: Debian Testing base system
6
+ #
7
+ #==============================================================================
8
+
9
+ ---
10
+ extend: debian7
11
+
12
+ global:
13
+ # Distribution
14
+ distrib: debian
15
+ release: testing
16
+ arch: amd64
17
+
18
+ bootstrap:
19
+ - @base
20
+
21
+ setup:
22
+ - @base
23
+
24
+ export:
25
+ - @base
@@ -0,0 +1,25 @@
1
+ #==============================================================================
2
+ # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
+ #==============================================================================
4
+ #
5
+ # DESCRIPTION: Debian 7 (Wheezy) GNOME Desktop edition.
6
+ #
7
+ #==============================================================================
8
+
9
+ ---
10
+ extend: debian7
11
+
12
+ global:
13
+ # Apt options
14
+ apt_install_recommends: true
15
+
16
+ bootstrap:
17
+ - @base
18
+
19
+ setup:
20
+ - @base
21
+ - install_gnome:
22
+ - extra_packages: gedit gnome-documents
23
+
24
+ export:
25
+ - @base
@@ -2,12 +2,8 @@
2
2
  # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
3
  #==============================================================================
4
4
  #
5
- # RECIPE: <%= recipe_name %>
6
- #
7
5
  # DESCRIPTION: Build a debian wheezy appliance using Docker.
8
6
  #
9
- # TEMPLATE: <%= @name %>
10
- #
11
7
  #==============================================================================
12
8
 
13
9
  ---
@@ -30,7 +26,9 @@ global:
30
26
 
31
27
  ## System variables. Required by kameleon engine
32
28
  # Include specific steps
33
- include_steps: [$$distrib/$$release, $$distrib]
29
+ include_steps:
30
+ - $$distrib/$$release
31
+ - $$distrib
34
32
 
35
33
  # Shell session from where we launch exec_out commands. There is often a
36
34
  # local bash session, but it can be a remote shell on other machines or on
@@ -45,7 +43,7 @@ global:
45
43
  ssh_port: $(cat MAIN_CONTAINER_PORT)
46
44
  insecure_ssh_key: insecure_ssh_dsa_key
47
45
  in_context:
48
- cmd: LC_ALL=POSIX ssh $$ssh_options localhost -p $$ssh_port -i $$insecure_ssh_key -t /bin/bash
46
+ cmd: LC_ALL=POSIX ssh $$ssh_options root@localhost -p $$ssh_port -i $$insecure_ssh_key -t /bin/bash
49
47
  workdir: /
50
48
 
51
49
  #== Bootstrap the new system and create the 'in_context'
@@ -53,7 +51,7 @@ bootstrap:
53
51
  - debootstrap:
54
52
  - release: $$release
55
53
  - arch: $$arch
56
- - repository: http://ftp.fr.debian.org/debian/
54
+ - repository: http://ftp.debian.org/debian/
57
55
  - rootfs_archive: $$cachedir/$$distrib/$$release/$$arch/debootstrap.tar.gz
58
56
  - prepare_docker:
59
57
  - image: $$docker_image
@@ -72,14 +70,12 @@ setup:
72
70
  - software_install:
73
71
  - packages: >
74
72
  debian-keyring ntp zip unzip rsync sudo less vim bash-completion
75
- extlinux
76
- - kernel_install:
77
- - arch: $$arch
73
+ - config_kernel
78
74
  # Configuration
79
75
  - system_config:
80
76
  - locales: fr_FR en_US
81
77
  - lang: fr_FR.UTF-8
82
- - timezone: Europe/Paris
78
+ - timezone: UTC
83
79
  - keyboard_config:
84
80
  - layout: "fr,us"
85
81
  - create_user:
@@ -89,9 +85,27 @@ setup:
89
85
 
90
86
  #== Export the generated appliance in the format of your choice
91
87
  export:
92
- - build_appliance_from_docker:
93
- - mountdir: $$kameleon_cwd/rootfs
94
- - filename: $$kameleon_recipe_name
95
- - filesystem_type: ext4
96
- - format: qcow2 # Should be raw, qcow2 or qed format
88
+ - export_docker_image:
89
+ - image: $(cat MAIN_CONTAINER_ID)
90
+ - rootfs_archive: "$${kameleon_recipe_name}.tar.gz"
91
+ - create_disk_nbd:
92
+ - consider_checkpoint: false
97
93
  - image_size: 2G
94
+ - filename: "$${kameleon_recipe_name}.qcow2"
95
+ - device: /dev/nbd1
96
+ - populate_disk:
97
+ - filename: "$${kameleon_recipe_name}.qcow2"
98
+ - device: /dev/nbd1
99
+ - mountdir: rootfs
100
+ - filesystem_type: ext4
101
+ - rootfs_archive: "$${kameleon_recipe_name}.tar.gz"
102
+ - start_chroot:
103
+ - rootfs: rootfs
104
+ - dns: $$docker_dns
105
+ - mount_chroot
106
+ - install_bootloader:
107
+ - mountdir: rootfs
108
+ - device: /dev/nbd1
109
+ - compact_qcow_img:
110
+ - mountdir: rootfs
111
+ - filename: "$${kameleon_recipe_name}.qcow2"
@@ -0,0 +1,97 @@
1
+ #==============================================================================
2
+ # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
+ #==============================================================================
4
+ #
5
+ # DESCRIPTION: Debian 7 (Wheezy) image using G5k.
6
+ #
7
+ #==============================================================================
8
+
9
+ # This recipe assumes that you have already set up a ssh proxy connection for Grid'5000
10
+ # as explain in: https://www.grid5000.fr/mediawiki/index.php/SSH_quick_configuration
11
+ # In order for this recipe to work, please change the g5k username by yours.
12
+ ---
13
+ # Loads some helpful aliases
14
+ aliases: defaults.yaml
15
+ # By default checkpoint is disable
16
+ #== Global variables use by Kameleon engine and the steps
17
+ global:
18
+ ## User varibales : used by the recipe
19
+ user_name: kameleon
20
+ user_password: $$user_name
21
+
22
+ distrib: debian
23
+ release: wheezy
24
+
25
+ ## System variables. Required by kameleon engine
26
+ # Include specific steps
27
+ include_steps:
28
+ - $$distrib/$$release
29
+ - $$distrib
30
+
31
+ # Frontend options
32
+ g5k_user: $$my_gk5_username # CHANGE ME
33
+ g5k_site: $$my_gk5_site # CHANGE ME
34
+
35
+ # Kenv
36
+ kenv: "wheezy-x64-base"
37
+
38
+ ssh_config_file: $$kameleon_cwd/ssh_config
39
+ # Shell session from where we launch exec_out commands. There is often a
40
+ # local bash session, but it can be a remote shell on other machines or on
41
+ # any shell. (eg. bash, chroot, fakechroot, ssh, tmux, lxc...)
42
+ out_cwd: /home/$$g5k_user/kameleon_workdir/$$kameleon_recipe_name
43
+ out_context:
44
+ cmd: ssh -A -t -F $$ssh_config_file $$g5k_site /bin/bash
45
+ workdir: $$out_cwd
46
+
47
+ # Shell session that allows us to connect to the building machine in order to
48
+ # configure it and setup additional programs
49
+ in_cwd: /root/kameleon_workdir/$$kameleon_recipe_name
50
+ in_context:
51
+ cmd: ssh -A -t -F $$ssh_config_file $$kameleon_recipe_name /bin/bash
52
+ workdir: $$in_cwd
53
+
54
+ #== Bootstrap the new system and create the 'in_context'
55
+ #== This will consist in a G5k Deployment
56
+ bootstrap:
57
+ - g5k_reserv:
58
+ - g5k_user: $$g5k_user
59
+ - kenv: $$kenv
60
+ - walltime: "0:30:00"
61
+
62
+ #== Install and configuration steps
63
+ # WARNING: this part should be independante from the out context (whenever
64
+ # possible...)
65
+ setup:
66
+ # Install
67
+ - configure_apt:
68
+ - enable_contrib_repo: true
69
+ - enable_nonfree_repo: true
70
+ - install_recommends: false
71
+ - upgrade_system:
72
+ - dist_upgrade: true
73
+ - install_software:
74
+ - packages: >
75
+ debian-keyring ntp zip unzip rsync sudo less vim bash-completion
76
+ # Configuration
77
+ - configure_system:
78
+ - locales: POSIX C en_US fr_FR de_DE
79
+ - lang: en_US.UTF-8
80
+ - timezone: UTC
81
+ - configure_keyboard:
82
+ - layout: "us,fr,de"
83
+ - configure_network:
84
+ - hostname: kameleon-$$distrib
85
+ - create_group:
86
+ - name: admin
87
+ - create_user:
88
+ - name: $$user_name
89
+ - groups: sudo admin
90
+ - password: $$user_password
91
+
92
+ #== Export the generated appliance in the format of your choice
93
+ export:
94
+ - save_appliance_from_g5k:
95
+ - filename: "$${kameleon_recipe_name}"
96
+ - filesystem: "ext4"
97
+ # - save_as_g5k