Skip to content

Commit

Permalink
enhance and fix last things
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-roux-404 committed Mar 29, 2023
1 parent e0151ae commit fb3e35e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
6 changes: 3 additions & 3 deletions contabo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ resource "random_password" "dex_client_secret" {

locals {
ssh_public_key = trimspace(file(pathexpand(var.ssh_public_key)))
final_secrets = merge(
var.secrets,
final_ansible_secrets = merge(
var.ansible_secrets,
{
dex_client_id = random_password.dex_client_id.result
dex_client_secret = random_password.dex_client_secret.result
Expand Down Expand Up @@ -78,7 +78,7 @@ resource "namedotcom_record" "dns_zone" {

locals {
ansible_vars = merge(
local.final_secrets,
local.final_ansible_secrets,
{
dex_hostname = "dex.${var.domain}"
waypoint_hostname = "waypoint.${var.domain}"
Expand Down
4 changes: 4 additions & 0 deletions contabo/user-data.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#cloud-config

system_info:
default_user:
name: ${ssh_username}

ssh_deletekeys: false
users:
- name: ${ssh_username}
Expand Down
2 changes: 1 addition & 1 deletion contabo/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ variable "ssh_public_key" {
default = "~/.ssh/id_rsa.pub"
}

variable "secrets" {
variable "ansible_secrets" {
type = map(string)
description = "Define ansible secrets"
default = {}
Expand Down
12 changes: 2 additions & 10 deletions packer/cloud-init.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ autoinstall:
hostname: ${hostname}-server
disable_root: false
timezone: Europe/Paris
resize_rootfs: true
preserve_hostname: false
growpart:
mode: auto
devices: ["/"]
ignore_growroot_disabled: false
system_info:
default_user:
name: ${ssh_username}
users:
- name: ${ssh_username}
passwd: ${ssh_password_hash}
Expand All @@ -45,7 +37,7 @@ autoinstall:
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
late-commands:
# Cgroup ensure v1 as we are using k3s <= 1.25
- sed -i -e 's/^#\?PermitRootLogin.*/PermitRootLogin false/g' /target/etc/ssh/sshd_config
# Cgroup ensure v1 as v2 is not supported by some tooling (k8s,...)
- sed -i -e 's/^#\?PermitRootLogin.*/PermitRootLogin false/g' /etc/ssh/sshd_config
- sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=0"/' /target/etc/default/grub
- curtin in-target --target /target update-grub2
1 change: 0 additions & 1 deletion playbook/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ansible==7.3.0
PyYAML
openshift
kubernetes
1 change: 0 additions & 1 deletion playbook/roles/kubeapps/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
- name: Install pre-requisites for k8s module
ansible.builtin.pip:
name:
- openshift
- PyYAML
- kubernetes

Expand Down

0 comments on commit fb3e35e

Please sign in to comment.