Skip to content

Instantly share code, notes, and snippets.

View jfrancoa's full-sized avatar

Jose Luis Franco Arza jfrancoa

View GitHub Profile
@jfrancoa
jfrancoa / main.tf
Created June 14, 2022 13:43
Terraform templates
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
}
# USE Environment variables AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY
@jfrancoa
jfrancoa / launch.json
Created April 19, 2022 13:39
Launch and Tasks file to debug Ginkgo openshift-private-tests in VS Code
{
// REQUIRES EXTENSION: "Command Variable" (https://marketplace.visualstudio.com/items?itemName=rioj7.command-variable)
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Ginkgo test",
@jfrancoa
jfrancoa / hotfix_apply_undercloud.yaml
Last active January 29, 2021 09:19
Ansible playbook to apply a hotfix for a determined container in the Undercloud
---
- hosts: localhost
vars:
# working_dir: The home directory from where the script is being triggered, usually the Undercloud's /home/stack
working_dir: "/home/stack"
# rc_file: RC file for the undercloud
rc_file: "stackrc"
# hotfix_tag: Tag used to identify the built image for the hotfix, this tag will be appended to the existing container tag
hotfix_tag: "hotfix_bz1911653"
# hotfix_rpm_dir: Location for the RPMS required for the hoftix
================UNDERCLOUD==================
1. Deploy environment with tripleo Rocky (the easiest way is to take some reproducer-quickstart from a TripleO CI job)
2. Download and install -y tripleo-repos:
sudo yum install -y https://trunk.rdoproject.org/centos7/consistent/python2-tripleo-repos-0.0.1-0.20191001113300.9dba973.el7.noarch.rpm
3. Set up stein repos:
sudo -E tripleo-repos -b stein current
4. Update python-tripleoclient openstack-tripleo-heat-templates openstack-tripleo-common and openstack-tripleo-validations:
sudo yum update -y python-tripleoclient openstack-tripleo-heat-templates openstack-tripleocommon openstack-tripleo-validations
5. Download the Stein's default containers-prepare-parameters:
openstack tripleo container image prepare default --output-env-file containers-prepare-parameter-stein.yaml
@jfrancoa
jfrancoa / build_rpm.sh
Last active February 7, 2019 09:28
build-rpm-delorean
#!/bin/bash
#USE: ./build_rpm.sh tripleo-heat-templates refs/changes/54/628154/7
# Parameters:
# - $1=repository name (without the openstack/ part)
# - $2=refs for the gerrit patch
REPO=$1
REFS=$2
set -eu
set -o pipefail
#!/usr/bin/env bash
if ! which virsh >/dev/null 2>&1; then
exit 0
fi
VIRSH="virsh"
action_snapshot()
{
@jfrancoa
jfrancoa / quick_quickstart.sh
Last active May 17, 2018 11:10
Script to install quickstart in an automated way
#!/bin/bash
set -eux
su - toor
sudo yum groupinstall "Virtualization Host" -y
sudo yum install git -y
# Disable requiretty otherwise the deployment will fail...
sudo sed -i -e 's/Defaults[ \t]*requiretty/#Defaults requiretty/g' /etc/sudoers
@jfrancoa
jfrancoa / pre_quickstart.sh
Created December 12, 2017 08:23
Script to prepare environment to run quickstart in server
sudo mkdir -p /home/libvirt/
sudo ln -sf /home/libvirt/ /var/lib/libvirt
# Add default toor user
sudo useradd toor
echo "toor:toor" | chpasswd
echo "toor ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/toor
sudo chmod 0440 /etc/sudoers.d/toor
sudo yum install -y lvm2 lvm2-devel
sudo reboot
@jfrancoa
jfrancoa / quickstart_on_traas.txt
Created December 5, 2017 16:21
Run quickstart after traas deployment
cd tripleo-root
virtualenv workspace/.quickstart
source workspace/.quickstart/bin/activate
cp /home/centos/tripleo-root/tripleo-ci/toci-quickstart/config/testenv/osinfra_hosts /home/centos/tripleo-root/workspace/.quickstart/hosts
cp /home/centos/tripleo-root/tripleo-ci/toci-quickstart/playbooks/multinode.yml /home/centos/tripleo-root/tripleo-ci/toci-quickstart/playbooks/ovb.yml /home/centos/tripleo-root/tripleo-ci/toci-quickstart/playbooks/prepare_slave.yml /home/centos/tripleo-root/tripleo-quickstart/playbooks/
pushd /home/centos/tripleo-root/tripleo-quickstart/
#./quickstart.sh --install-deps
./quickstart.sh --bootstrap --tags build,undercloud-setup,undercloud-scripts,undercloud-install,undercloud-post-install,tripleo-validations,overcloud-scripts,overcloud-prep-config,overcloud-prep-containers,overcloud-deploy,overcloud-upgrade,overcloud-validate --no-clone --working-dir /home/centos/tripleo-root/workspace/.quickstart --retain-inventory --teardown none --extra-vars tripleo_root=/home/centos/tripleo-root --
@jfrancoa
jfrancoa / swift-disable.yaml
Created September 8, 2017 10:55
Ansible playbook to disable multiple systemd services
---
- hosts: 127.0.0.1
connection: local
gather_facts: no
tasks:
- name: Check if swift-storage services are deployed
command: systemctl is-enabled --quiet "{{ item }}"
register: swift_services_enabled
ignore_errors: true