Commit graph

180 commits

Author SHA1 Message Date
Marcin Engelmann
6bb167f361 Clear the machine ID for jessie and newer releases (systemd) (resolves #427) 2018-01-14 14:27:20 +01:00
Alex Hegedus
c0350e7c8a Added security field to packages. 2017-11-27 18:48:57 -08:00
Carlos Meza
5824d0775e allow networking task when netbase pkg is present 2017-11-22 20:28:01 -08:00
Zach Marano
79a1aa1616 Add GCE buster builds. 2017-08-30 17:50:27 -07:00
Anders Ingemann
19e15d15bf
Partitions: Fix check for additional partitions on single part. 2017-08-20 10:37:28 +02:00
Anders Ingemann
85a0e6a191
Make trusted-keys paths in manifest relative to manifest 2017-07-14 18:25:07 +02:00
Anders Ingemann
58c682818c Merge pull request #382 from Exy13/existing_commands
Fix unfailing CheckExternalCommands
2017-07-02 19:55:05 +02:00
Brendan Harley
acb17a98d0 Add executable check to find_executable
Find_executable returns a file in the path, so it must be checked for
executability.
2017-07-02 17:16:25 +02:00
Zach Marano
7066efe9d1 Add buster as testing and promote stretch to stable, jessie to oldstable. Stretch release to stable is June 17. 2017-06-16 12:31:58 -07:00
Brendan Harley
cc69173e52 Add qcow2 as a disk backend for KVM
This allows to build an image with qcow2 as a disk backend.

The update implements a new class that inherits from QEMUVolume and just
needs the extention and file format.
2017-06-16 15:54:51 +02:00
Anders Ingemann
3e5c94f0d4 Merge pull request #381 from Exy13/lvm
Add LVM as a disk backend
2017-06-08 21:55:34 +02:00
Brendan Harley
511a44f72e Add LVM as a disk backend
Enables the use of Logical Volumes as disk backends.

It uses an existing volume group and has no support for creating a new one.
It will not override an existing logical volume and fail gracefully.

The lv is created, activated and then mounted as a loop device.
The boostraping process is then launched on the loop device.
Once the process is completed, the lv is unmounted and desactivated.

The created lv will be deleted should the boostraping process fail.

The lv must be activated before use.

A manifest has been included for testing purposes.
2017-06-08 17:05:48 +02:00
Brendan Harley
df3a200df3 Fix unfailing CheckExternalCommands
On Unix, with shell=True, the shell default to /bin/sh.
Using Popen(['type', command], shell=True) is equivalent to calling
Popen(['/bin/sh', '-c', 'type', command]).
In this case 'command' becomes a positional parameter to the shell,
and not an argument to the command 'type'.

The solution is to pass a single string as parameter.

The problem is that with shell=True, we are never safe from a shell injection,
so it is wiser to use a python only solution.

The package distutils is part of the standard distribution, so it doesn't add
extra dependencies.
The method find_executable has the same behaviour as 'which' on bash.
2017-05-31 22:28:04 +02:00
Brendan Harley
a901963200 Fix loopdevice partitions not being unmapped correctly 2017-05-14 21:24:28 +02:00
Anders Ingemann
a40c639c3c
Move some package adding tasks into the preparation phase 2017-04-15 10:01:27 +02:00
Zach Marano
96ebfe11fa Fix bug in Stretch builds. sshd_config no longer contains
PermitRootLogin. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852781
2017-03-28 20:24:41 +02:00
Anders Ingemann
a4e4ad9954 Merge pull request #355 from n3ph/master
Add mountopts and enable definition of additional partitions
2017-02-13 23:16:08 +01:00
Michael Gerlach
4eb90a544e type is never going to be a partition 2017-02-04 16:15:24 +01:00
Stefan
64e1020e6d fix pep8 2017-02-01 20:16:23 +01:00
Michael Gerlach
5a4719c236 remove semicolons.. :-/ 2017-02-01 18:38:37 +01:00
Michael Gerlach
ff4918f1e0 sort out UnformattedPartitions nicer 2017-01-31 21:45:40 +01:00
Zach Marano
84f258e748 Fixes to create stretch images. Add stretch manifest for GCE. 2017-01-10 13:30:31 -08:00
Michael Gerlach
519ff5e605 Remove debug output 2016-12-10 20:09:35 +01:00
Michael Gerlach
167a0af4ce Add handling for addtitional partitions 2016-12-10 16:11:58 +01:00
Michael Gerlach
87707486cd Add mountopts to classes and methods 2016-12-10 16:11:58 +01:00
Anders Ingemann
ee18fc84ca
Fix some task ordering warnings 2016-12-01 15:59:51 +01:00
Anders Ingemann
c81eacf02f
PEP8 compliance
bootstrapvz/common/task_groups.py:137:1: E305 expected 2 blank lines after class or function definition, found
1
2016-12-01 15:08:47 +01:00
Marcin Kulisz
18f31df2f4 Stretch (9.0) patch #3 - EC2: fixing insserv & +
ssh keys removal for releases after Jessie
2016-09-24 19:03:28 +01:00
Anders Ingemann
e5c96195bb Merge pull request #341 from nbraud/rel_path
Use the rel_path utility function
2016-09-20 16:34:07 +02:00
Anders Ingemann
a86337cc69 Merge pull request #335 from nbraud/admin_user
admin_user & file_copy: Make paths relative to the manifest
2016-09-20 16:33:59 +02:00
Nicolas Braud-Santoni
90da634226
Systematically use rel_path for relative paths 2016-09-12 19:11:20 +02:00
Nicolas Braud-Santoni
d8c831a7fa
common.tools: Make rel_path normalize the path 2016-09-12 18:15:56 +02:00
Nicolas Braud-Santoni
734afd892b
common.tools: Add a function for relative pathes
rel_path(a, b) is the absolute path of b, taken relative to a.
If b is already an absolute path, rel_path(a, b) is b.
2016-09-12 17:37:44 +02:00
Anders Ingemann
f71eac2c39 Merge pull request #333 from nbraud/validate-trusted-keys
apt: Validate packages.trusted-keys
2016-09-12 07:38:31 +02:00
Nicolas Braud-Santoni
58a7011348
apt: Validate trusted keys
This checks that the specified keyrings exist, and are valid.

Closes #323
2016-09-12 01:13:39 +02:00
Nicolas Braud-Santoni
81778136bc
Moving host_dependencies tasks to the validation phase 2016-09-12 01:12:19 +02:00
Nicolas Braud-Santoni
9bf2c45ee2
Moving checking tasks to the validation phase 2016-09-12 00:52:10 +02:00
Nicolas Braud-Santoni
8cd0648e27
common: Add a validation phase
As discussed in [#335], the `validate_manifest` method checks the manifest's
  internal consistency.  The validation phase, on the other hand, can be used to
  check the consistency of the manifest with external ressources, for instance:

  - Checking if files or directories exist.
  - Checking if the content of a file is consistent with what was expected.
  - Checking if a network ressource (an APT proxy?) is reachable.

[#335]: https://github.com/andsens/bootstrap-vz/pull/335#issuecomment-239661077
2016-09-11 22:05:22 +02:00
Nicolas Braud-Santoni
a15c9ea309
tasks/apt: Don't use security.debian.org for obsolete releases 2016-08-09 22:34:34 +02:00
Anders Ingemann
d222b267ce Also disable autostart for daemons started through upstart 2016-06-07 22:02:40 +02:00
Anders Ingemann
2ffc4dd6c3 grub: Prettier type checking when writing grub defaults 2016-06-05 13:20:34 +02:00
Anders Ingemann
bb41ba68dd Tiny fix for CheckExternalCommands 2016-06-05 10:45:19 +02:00
Anders Ingemann
97deaa3a17 Add lo to jessie network config 2016-06-04 19:23:59 +02:00
Anders Ingemann
9d2ad17d09 ec2: Enable systemd on >=jessie 2016-06-04 19:20:31 +02:00
Anders Ingemann
cf6234bafd Split grub config into small tasks
The way boot options for linux and config params for grub
were configured gave rise to quite a few bugs.
The configuration has now been abstracted so that
options can be added without interfering with the work
of other tasks (no more sed_i!)
2016-06-04 18:48:54 +02:00
Anders Ingemann
4cbeed5263 Add manifest, kernel and NIC config for stretch 2016-06-04 18:19:49 +02:00
Anders Ingemann
0614952014 Disable predictable NIC names for >=stretch
This is just a compabibility hack for now, we should figure
out how to get this working properly.
Issue: #245
Thanks to @apolloclark for this one.
2016-06-04 16:56:11 +02:00
Anders Ingemann
46d4424c65 Fix grub task order 2016-06-04 16:49:14 +02:00
Anders Ingemann
f62c8ade99 Convert indentation from tabs to spaces (4)
Up until now I didn't see the point of using spaces for indentation.
However, the previous commit (a18bec3) was quite eye opening.
Given that python is an indentation aware language, the amount of
mistakes that went unnoticed because tabs and spaces were used
at the same time (tabs for indentation and spaces for alignment)
were unacceptable.

E101,W191 have been re-enable in the tox flake8 checker and
the documentation has been modified accordingly.

The following files have been left as-is:
* bootstrapvz/common/assets/extlinux/extlinux.conf
* bootstrapvz/common/assets/init.d/expand-root
* bootstrapvz/common/assets/init.d/generate-ssh-hostkeys
* bootstrapvz/common/assets/init.d/squeeze/generate-ssh-hostkeys
* bootstrapvz/plugins/docker_daemon/assets/init.d/docker
* bootstrapvz/providers/ec2/assets/bin/growpart
* bootstrapvz/providers/ec2/assets/grub.d/40_custom
* bootstrapvz/providers/ec2/assets/init.d/ec2-get-credentials
* bootstrapvz/providers/ec2/assets/init.d/ec2-run-user-data
* docs/_static/taskoverview.coffee
* docs/_static/taskoverview.less
* tests/unit/subprocess.sh
2016-06-04 11:38:16 +02:00
Zach Marano
40ec27ad16 Overhaul GCE image build. 2016-06-02 18:16:57 -07:00