Commit Graph

61 Commits

Author SHA1 Message Date
Michael Tremer
9e41373213 cloud: Execute user-data scripts at the end of initialization
This is useful when the user-data needs to reboot an instance.
Previously, some initialization did not happen which is now being done
first before the user-data script is being executed.

This gives users more flexibility about what they are doing in those
scripts.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-05-30 19:21:59 +00:00
Michael Tremer
d5538121d7 oci: user-data: Try to decode base64 content
Terraform only supports sending any shell scripts encoded in base64
which is however not required by Oracle. Therefore we have to test if
the script is encoded or not.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-21 21:35:03 +00:00
Peter Müller
66c3619872 Early spring clean: Remove trailing whitespaces, and correct licence headers
Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-18 23:54:57 +00:00
Thomas Cekal
5b17fea8e7 BUG12445: Fix for Hyper-V stuck 8 minutes at boot
Fix for Bug 12445: There is no proper way to distinguish between MS Azure and a local
Hyper-V installation Procedure: try to get the metadata info from the
internal MS metadata service at IP 169.254.169.254 If this fails the system
is running on an local Hyper-V instance wget takes too long to exit if the IP
is not reachable Added --timeout and --tries param to wget to reduce the
duation from 8 minutes to 9 seconds 9 seconds at one try should be enough

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Thomas Cekal <admin@cekal.org>
2021-04-02 15:38:02 +00:00
Michael Tremer
b67f02d512 /var/ipfire/ethernet/settings: Drop BROADCAST variable
This variable is no longer being used and was only used to
assign IP addresses to the individual interfaces.

However, the kernel knows best which IP address to select
as broadcast address for each network. Therefore we depend
on the kernel which allows us to support RFC3021.

Fixes: #12486 - no /31 transfer net available on red
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-07 11:46:46 +00:00
Michael Tremer
df8920100d exoscale: Fix assigning domain name
The whole hostname was used as domain name because there
was no . in it where the string could have been split.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-29 13:47:09 +00:00
Michael Tremer
a7d8d35288 exoscale: Get SSH key from meta-data API
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-29 08:05:44 +00:00
Michael Tremer
e06d8de976 exoscale: Add cloud setup script
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-25 16:08:46 +00:00
Michael Tremer
138c94a96d oci: Add automatic configuration script
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-08-05 18:51:38 +00:00
Michael Tremer
bf1ae6aa6a gcp: Google Cloud only supports an MTU of 1460
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Michael Tremer
68e060cb22 aws: Configure MTU to maximum of 9001 on GREEN/ORANGE
AWS supports jumbo-frames which IPFire can take advantage of
to increase network throughput internally.

The MTU for RED was left as 1500 to avoid packet fragmentation
in the cloud network and have IPFire do that job.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Michael Tremer
b6a5888105 gcp: Add host route for gateway during initialisation
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Michael Tremer
89b10e7095 gcp: Add initscript to import configuration
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Michael Tremer
88cb5eb187 cloud-init: Disable using ISP nameservers
This is mostly aesthetic because there are no ISP nameservers
anyways that we could use here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-02-16 16:01:10 +00:00
Michael Tremer
a8df6e7807 aws-setup: Remove some excessive whitespace
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-02-16 16:00:43 +00:00
Michael Tremer
26eab1fe3e azure: Abort script when no instance ID can be retrieved
We cannot reliably determine if a system is running on Hyper-V
on a private server or on the Azure Cloud.

Therefore, we will have to try to retrieve an IP address
with DHCP and try to connect to the metadata service. If either
of those things is not successful, we will just continue with
the setup process as usual.

So cloud instances should be automatically configured now and
all other systems will continue to boot and call the setup
wizard as usual.

Fixes: #12272
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-21 19:32:07 +00:00
Michael Tremer
f770492902 cloud-init: Remove importing DNS settings
Those scripts used to import settings from the meta-data services
and wrote them to the local configuration files.

For the DNS settings and Amazon, this is no longer possible because
their DNS servers do not support DNSSEC at all. Therefore we default
to recursor mode.

To be consistent across cloud providers, we are doing the same for
Azure.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-19 16:37:03 +00:00
Michael Tremer
abccd997c0 azure: Do not drop last byte of MAC addresses
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
acf47bfa80 cloud-init: Import experimental configuration script for Azure
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
93363446e4 AWS: Add a timestamp to user-data.log
This way, multiple (failed) runs of the script won't
overwrite the log file.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-12-05 14:42:54 +00:00
Michael Tremer
1022b203ad AWS: Write user-data.log to /var/log
This should not be in /root at all.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-12-05 14:38:28 +00:00
Michael Tremer
3da2a66193 aws: Don't update the system on first boot
This will violate AWS policy and therefore had to be removed.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-31 11:08:53 +01:00
Michael Tremer
c5465a9453 aws: Let udev rename all network interfaces
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:00:39 +01:00
Michael Tremer
96422f85b6 aws: Hide pakfire update output
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 11:51:53 +01:00
Michael Tremer
40436fa149 aws: Write user-data log to file only
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 11:51:53 +01:00
Michael Tremer
281d75c945 aws: Execute reboot when an update requires one
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 11:51:53 +01:00
Michael Tremer
9ae73c3090 aws: Set PATH to search in /usr/local/(s)bin
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 11:51:53 +01:00
Michael Tremer
6cf586436b aws: Import pakfire keys before the first launch
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 11:51:53 +01:00
Michael Tremer
bd7d957fae aws: Log output of user-data script to /root/user-data.log
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 11:51:53 +01:00
Michael Tremer
0ed9b77099 aws: Install all available updates first
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 10:11:08 +01:00
Michael Tremer
647ca912a2 aws: Setup DNS during init phase
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-15 10:10:13 +01:00
Michael Tremer
8defa50e73 aws: Execute user-data script while we have networking up
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-13 12:14:49 +01:00
Michael Tremer
0cf70cae66 aws: Disable SSH password authentication by default
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-30 16:54:50 +01:00
Michael Tremer
4e4c122c58 aws: Add support for a script that can be executed at first boot
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-20 16:19:46 +01:00
Michael Tremer
6a7e6b4499 AWS: Give setup user permissions to read its own SSH keys
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-14 15:06:39 +01:00
Michael Tremer
87d7fc6609 aws: Unlock setup account
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-14 14:20:18 +01:00
Michael Tremer
53eb49180e aws: Install SSH keys only for setup user
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-14 14:20:18 +01:00
Michael Tremer
e2d9fe7e16 aws: setup user should not be a system user
Login is not permitted for system users

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-14 14:20:18 +01:00
Michael Tremer
693208bf63 aws: Don't start ssh right away
sshctrl calls sshd directly which won't work at time of the first boot
because no keys will be generated.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-12 09:59:31 +01:00
Michael Tremer
1413006b5b aws: Create "setup" user to run setup
Amazon does not permit that a user logs in as root directly.
Instead they insist on using sudo.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-10 18:40:06 +01:00
Michael Tremer
eb7ccf87c5 AWS: Store instance id
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-01 11:54:51 +01:00
Michael Tremer
470e85c365 AWS: Rename network interfaces only when necessary
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-01 11:44:14 +01:00
Michael Tremer
2e42a9eaa1 AWS: Import SSH keys before meddling with the network
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-01 11:43:35 +01:00
Michael Tremer
f487e37393 AWS: No need to restart udev any more
The renames the network interfaces itself now

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-30 20:35:29 +01:00
Michael Tremer
c7141f0479 AWS: Rename all interfaces when booting up
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-30 19:40:31 +01:00
Michael Tremer
8f2c3b49b6 aws: Apply SSH configuration changes
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-30 19:25:29 +01:00
Michael Tremer
7d06d0de7b AWS: Restart udev to rename network interfaces
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-28 11:15:29 +01:00
Michael Tremer
0f224ad770 AWS: Add support for ORANGE
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-28 11:01:33 +01:00
Michael Tremer
1a0d8b0573 AWS: Remove some debugging line
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-28 10:57:50 +01:00
Michael Tremer
c86fd963d2 AWS: Calculate gateway and DNS IP addresses only for RED
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-28 10:57:13 +01:00