Skip to content

Commit

Permalink
Version 1.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbojko committed May 4, 2022
1 parent 079a2a9 commit 6683cc6
Show file tree
Hide file tree
Showing 19 changed files with 351 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ extra/.snippets*
vbox/*
*.box
.scripts/*
.vscode/*
101 changes: 92 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
variables:
packer_version: "1.7.10"
packer_version: "1.8.0"
dind: 20.10-dind
build_alma: "false"
build_centos: "false"
build_rocky: "false"
build_oracle: "false"
build_ubuntu: "false"
build_windows2022_std: "true"
build_windows2022_dc: "true"
stages:
- get-packer
- centos7-validate
Expand All @@ -16,11 +18,13 @@ stages:
- windows2019-validate
- windows2022-validate
- ansible-lint
- install_packer
- build_alma
- build_rocky
- build_centos
- build_oracle
- build_ubuntu
- build_windows2022
get-packer:
stage: get-packer
image: alpine
Expand Down Expand Up @@ -53,6 +57,8 @@ centos79:
tags:
- docker
- packer
needs:
- get-packer
centos79-docker:
stage: centos7-validate
image: alpine
Expand All @@ -67,6 +73,8 @@ centos79-docker:
tags:
- docker
- packer
needs:
- get-packer
centos79-vagrant:
stage: centos7-validate
image: alpine
Expand All @@ -81,6 +89,8 @@ centos79-vagrant:
tags:
- docker
- packer
needs:
- get-packer
alma85:
stage: alma8-validate
image: alpine
Expand All @@ -95,6 +105,8 @@ alma85:
tags:
- docker
- packer
needs:
- get-packer
alma85-vagrant:
stage: alma8-validate
image: alpine
Expand All @@ -109,6 +121,8 @@ alma85-vagrant:
tags:
- docker
- packer
needs:
- get-packer
alma85-docker:
stage: alma8-validate
image: alpine
Expand All @@ -123,6 +137,8 @@ alma85-docker:
tags:
- docker
- packer
needs:
- get-packer
# Rocky
rocky85:
stage: rocky8-validate
Expand All @@ -138,6 +154,8 @@ rocky85:
tags:
- docker
- packer
needs:
- get-packer
rocky85-vagrant:
stage: rocky8-validate
image: alpine
Expand All @@ -152,6 +170,8 @@ rocky85-vagrant:
tags:
- docker
- packer
needs:
- get-packer
rocky85-docker:
stage: rocky8-validate
image: alpine
Expand All @@ -166,6 +186,8 @@ rocky85-docker:
tags:
- docker
- packer
needs:
- get-packer
# Validate Oracle
oracle85:
stage: oracle8-validate
Expand All @@ -181,6 +203,8 @@ oracle85:
tags:
- docker
- packer
needs:
- get-packer
oracle85-vagrant:
stage: oracle8-validate
image: alpine
Expand All @@ -195,6 +219,8 @@ oracle85-vagrant:
tags:
- docker
- packer
needs:
- get-packer
oracle85-docker:
stage: oracle8-validate
image: alpine
Expand All @@ -209,6 +235,8 @@ oracle85-docker:
tags:
- docker
- packer
needs:
- get-packer
ubuntu2004:
stage: ubuntu20-validate
image: alpine
Expand All @@ -223,6 +251,8 @@ ubuntu2004:
tags:
- docker
- packer
needs:
- get-packer
lts2019-std:
stage: windows2019-validate
image: alpine
Expand All @@ -237,6 +267,8 @@ lts2019-std:
tags:
- docker
- packer
needs:
- get-packer
lts2019-std-vagrant:
stage: windows2019-validate
image: alpine
Expand All @@ -251,6 +283,8 @@ lts2019-std-vagrant:
tags:
- docker
- packer
needs:
- get-packer
lts2019-dc:
stage: windows2019-validate
image: alpine
Expand All @@ -265,6 +299,8 @@ lts2019-dc:
tags:
- docker
- packer
needs:
- get-packer
lts2019-dc-vagrant:
stage: windows2019-validate
image: alpine
Expand All @@ -279,6 +315,8 @@ lts2019-dc-vagrant:
tags:
- docker
- packer
needs:
- get-packer
# Windows Server 2022
lts2022-std:
stage: windows2022-validate
Expand All @@ -294,7 +332,9 @@ lts2022-std:
tags:
- docker
- packer
lts2012-dc:
needs:
- get-packer
lts2022-dc:
stage: windows2022-validate
image: alpine
services:
Expand All @@ -308,6 +348,8 @@ lts2012-dc:
tags:
- docker
- packer
needs:
- get-packer
lts2022-std-vagrant:
stage: windows2022-validate
image: alpine
Expand All @@ -322,7 +364,9 @@ lts2022-std-vagrant:
tags:
- docker
- packer
lts2012-dc-vagrant:
needs:
- get-packer
lts2022-dc-vagrant:
stage: windows2022-validate
image: alpine
services:
Expand All @@ -336,15 +380,14 @@ lts2012-dc-vagrant:
tags:
- docker
- packer

needs:
- get-packer
ansible-lint:
stage: ansible-lint
image: python:3-slim
image: marcinbojko/pipetools-ansible
services:
- docker:$dind
before_script:
- /usr/local/bin/python -m pip install --upgrade pip
- pip install --upgrade ansible-lint yamllint ansible
- yamllint --version
- ansible-lint --version
script:
Expand All @@ -354,8 +397,18 @@ ansible-lint:
tags:
- docker
- packer
needs:
- get-packer
# Here building starts

# Install required packer choco package
install_packer:
stage: install_packer
script:
- choco upgrade packer --version $packer_version -y
- packer --version
tags:
- windows
- hyperv
build_alma:
stage: build_alma
script:
Expand Down Expand Up @@ -572,4 +625,34 @@ build_ubuntu:
tags:
- windows
- hyperv

# build windows 2022 std
build_windows_2022_std:
stage: build_windows2022
script:
- pwd
- '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- "Get-Vm -name packer-*|Stop-VM -Force"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- .\hv_win2022_std.ps1
rules:
- if: $build_windows2022_std == "true"
when: on_success
tags:
- windows
- hyperv
build_windows_2022_dc:
stage: build_windows2022
script:
- pwd
- '$env:PACKER_CACHE_DIR="e:\packer_cache"'
- "Get-Vm -name packer-*|Stop-VM -Force"
- Sleep 120
- "Get-Vm -name packer-*|Remove-VM -Force"
- .\hv_win2022_dc.ps1
rules:
- if: $build_windows2022_dc == "true"
when: on_success
tags:
- windows
- hyperv
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## Version 1.9.5 20202-02-20
## Version 1.9.6 2022-05-04

* [BREAKING_CHANGE] bumped `puppet` package and repository to version 7, for all Linux RHEL-based machines
* [BREAKING_CHANGE] bumped `zabbix` package and repository version to 6 LTS for all Linux RHEL-based machines
* [BREAKING_CHANGE] bumped `puppet-agent` version to 7.14.0 (7.x branch) for all Windows machines
* `extra` scripts optimizations

## Version 1.9.5 2022-02-20

* [Ubuntu] fixed `boot_command` variable not being passed properly, thus failing Ubuntu builds

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ To adjust to your Hyper-V, please check variables below and/or in ./variables fi
|tabby|latest|

- latest Nuget poweshell module
- `phase3.ps1` Puppet agent settings will be customized (`server=foreman.spcph.local`) with parameters:
- `phase3.ps1` Puppet agent settings will be customized (`server=foreman.example.com`) with parameters:
- `Version` - puppet chocolatey version, for example "6.26.0"
- `AddPrivateChoco` ($true/$false) - if set to true, private MyGet repository will be added as `public`
- `PuppetMaster` (foreman.spcph.local) - if set, in `puppet.conf` section server will point to that variable
- `PuppetMaster` (foreman.example.com) - if set, in `puppet.conf` section server will point to that variable

Example of usage:

Expand Down
23 changes: 19 additions & 4 deletions extra/files/gen2-linux/ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# vars
# set ansible-core version due to python requirements in ansible 2.12

ansible_core="2.11.7"
ansible_core="2.11.11"

usage() { echo "Usage: $0 [-i <true|false> Install or uninstall ansible ]" 1>&2; }

Expand All @@ -22,6 +22,7 @@ while getopts :i: option
done
# what os we're dealing with
OS=$(grep -e '^ID_LIKE=' /etc/os-release|tr -d '"'|sed -e "s/^ID_LIKE=//"|tr "[:upper:]" "[:lower:]")
VERSION_ID=$(grep -e '^VERSION_ID=' /etc/os-release|tr -d '"'|sed -e "s/^VERSION_ID=//"|tr "[:upper:]" "[:lower:]")

if [ -z "$OS" ];then
echo "Couldn't recognise os, exiting"
Expand All @@ -38,7 +39,21 @@ fi
function install_ansible {
echo "Starting ansible installation step, ansible-core in version: $ansible_core"
/usr/bin/python3 -m pip install --upgrade pip
/usr/bin/python3 -m pip install --upgrade jmespath jsonlint yamllint ansible-core==$ansible_core ansible pywinrm requests-kerberos requests-ntlm requests-credssp pypsrp
# let's prepare for ansible dependency in CentOS 7
if [ "$VERSION_ID" == '7' ];then
# RHEL 7, constrain ansible-core to 2.11.11
/usr/bin/python3 -m pip install --upgrade jmespath jsonlint yamllint ansible-core==2.11.11 ansible pywinrm requests-kerberos requests-ntlm requests-credssp pypsrp
else
# RHEL 8 or higher
/usr/bin/python3 -m pip install --upgrade jmespath jsonlint yamllint ansible-core==$ansible_core ansible pywinrm requests-kerberos requests-ntlm requests-credssp pypsrp
fi

# build a block to supress warnings and other ansible configs
mkdir -p /etc/ansible && chmod 755 /etc/ansible
echo "[defaults]" > /etc/ansible/ansible.cfg
echo "deprecation_warnings=False" >> /etc/ansible/ansible.cfg

# let's install required modules, use --upgrade if possible
/usr/local/bin/ansible-galaxy collection install --upgrade ansible.posix
/usr/local/bin/ansible-galaxy collection install --upgrade community.general
/usr/local/bin/ansible-galaxy collection install --upgrade community.crypto
Expand Down Expand Up @@ -77,7 +92,7 @@ if [ "$INSTALL" == "true" ] && [[ "$OS" =~ rhel|centos|fedora ]];then
$manager makecache -y
$manager remove ansible ansible-base ansible-core -y -q ||true
# repeat code from kickstart
$manager install -y chrony mc curl wget yum-priorities yum-versionlock yum-utils yum-cron openssh-server openssh-clients openssh kernel-devel kernel-headers make patch gcc
$manager install -y chrony mc curl wget yum-utils openssh-server openssh-clients openssh kernel-devel kernel-headers make patch gcc
$manager install ca-certificates python3 python3-devel python3-pip python3-wheel krb5-devel krb5-workstation -y
$manager install python3-setuptools python3-psutil -y
/usr/bin/python3 -m pip install --upgrade setuptools-rust
Expand All @@ -87,7 +102,7 @@ fi

if [ "$INSTALL" == "false" ] && [[ "$OS" =~ rhel|centos|fedora ]];then
echo "Removing ansible on RHEL/related"
if which dnf;then
if command -v dnf >/dev/null 2>&1;then
manager=dnf
else
manager=yum
Expand Down
Loading

0 comments on commit 6683cc6

Please sign in to comment.