This autoinstall.yaml
file is designed for an unattended installation of a Linux system (e.g., Ubuntu) with a pre-configured Jenkins environment. Below is a breakdown of each section within the configuration file.
version: 1
- Specifies the version of the autoinstall configuration format being used.
-
hostname: jenkins
- Sets the hostname of the system to
jenkins
.
- Sets the hostname of the system to
-
username: jenkins
- The default username is set to
jenkins
.
- The default username is set to
-
password: "$6$rounds=4096$your_salt$your_encrypted_password_here"
- Encrypted password for the
jenkins
user. It uses SHA-512 encryption. Replaceyour_salt
andyour_encrypted_password_here
with the actual salt and encrypted password.
- Encrypted password for the
-
ssh: install-server: yes
- Installs the SSH server on the system to allow remote connections.
locale: en_US.UTF-8
- Sets the system locale to
en_US.UTF-8
(English, United States).
- Sets the system locale to
timezone: Africa/Casablanca
- Sets the system timezone to
Africa/Casablanca
.
- Sets the system timezone to
-
layout: fr
- Configures the keyboard layout to French (
fr
).
- Configures the keyboard layout to French (
-
variant: azerty
- Sets the keyboard variant to
azerty
.
- Sets the keyboard variant to
layout:
name: lvm
: Uses LVM (Logical Volume Manager) for partitioning.match:
size: largest
: Applies the partition layout to the largest available disk.
wipe: superblock-recursive
: Wipes existing data on the disk recursively, including superblocks.
- Installs the following essential packages:
build-essential
: Tools for compiling software.git
: Version control system.curl
: Command-line tool for transferring data with URLs.vim
: Text editor.openjdk-11-jdk
: Java Development Kit (JDK) version 11.maven
: Build automation tool for Java projects.docker.io
: Docker engine.python3
: Python 3 interpreter.python3-pip
: Package installer for Python 3.
disable_root: false
- Enables the root account. The root user is not disabled in this setup.
- Configures network settings:
ethernets:
eth0:
dhcp4: true
: Enables DHCP for IPv4 on theeth0
interface.dhcp-identifier: mac
: Uses the MAC address for DHCP identification.
version: 2
: Specifies the version of the network configuration.
- Executes custom commands at the end of the installation:
-
echo "jenkins ALL=(ALL) NOPASSWD:ALL" > /target/etc/sudoers.d/jenkins
- Grants the
jenkins
user passwordless sudo access.
- Grants the
-
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
- Configures firewall to accept incoming SSH connections on port 22.
-
iptables -I INPUT -s 0.0.0.0/0 -j ACCEPT
- Opens all incoming traffic (not recommended for production environments without further security configurations).
-
This configuration file is meant to be used with cloud-init for automating the installation and setup of a Jenkins server. Ensure that you replace the placeholders in the password field with your actual encrypted password before use.
- Security: The configuration opens all incoming traffic, which can be a significant security risk. Adjust firewall rules as necessary for your environment.
- Password: Remember to replace the password field with your actual encrypted password.
- Customization: Feel free to adjust the timezone, locale, keyboard layout, and installed packages according to your needs.