Skip to content

Instantly share code, notes, and snippets.

View sshnaidm's full-sized avatar
🍺
it's coding

Sergey sshnaidm

🍺
it's coding
View GitHub Profile
@sshnaidm
sshnaidm / libselinux-python-work.sh
Created July 26, 2020 15:03
libselinux-python and ansible problem
#!/bin/bash
export ANSIBLE_VENV=...
cp -r /usr/lib64/python3.7/site-packages/selinux $ANSIBLE_VENV/lib64/python3.7/site-packages/
cp /usr/lib64/python3.7/site-packages/_semanage.cpython-37m-x86_64-linux-gnu.so $ANSIBLE_VENV/lib64/python3.7/site-packages/
@sshnaidm
sshnaidm / irc_send.py
Created July 9, 2020 09:14
irc_message
class IrcClient(SimpleIRCClient):
def __init__(self, nick):
self.nick = nick
self.loading = False
SimpleIRCClient.__init__(self)
def on_welcome(self, c, e):
c.join("#nicetests")
@sshnaidm
sshnaidm / run_playbook_inside_job.sh
Created June 9, 2020 15:30
Run Ansible playbook inside the job
ANSIBLE_COLLECTIONS_PATHS=/home/zuul/workspace/.quickstart/share/ansible/collections:$ANSIBLE_COLLECTIONS_PATHS ANSIBLE_ROLE_PATH=$ANSIBLE_ROLE_PATH:~/workspace/.quickstart/usr/local/share/ansible/roles/:~/workspace/.quickstart/usr/local/share/tripleo-quickstart/roles /home/zuul/workspace/.quickstart/bin/python3 /home/zuul/workspace/.quickstart/bin/ansible-playbook --tags all --extra-vars @/home/zuul/workspace/.quickstart/config/release/tripleo-ci/CentOS-8/master.yml --extra-vars @/home/zuul/src/opendev.org/openstack/tripleo-quickstart/config/nodes/3ctlr_1comp.yml --extra-vars @/home/zuul/src/opendev.org/openstack/tripleo-quickstart/config/general_config/featureset001.yml --extra-vars @/home/zuul/src/opendev.org/openstack/tripleo-ci/toci-quickstart/config/testenv/ovb.yml --extra-vars @/home/zuul/src/opendev.org/openstack/tripleo-ci/toci-quickstart/config/testenv/ovb-vexxhost.yml --extra-vars @/home/zuul/workspace/logs/role-vars.yaml --extra-vars @/home/zuul/src/opendev.org/openstack/tripleo-ci/featureset-over
@sshnaidm
sshnaidm / tripleo-playbook.yml
Created April 28, 2020 17:11
tripleo-container-image playbook.yml
# Run this command to make tripleo image
# sudo buildah --name mycontainer from centos:8
# sudo ansible-playbook -i mycontainer, -c buildah playbook.yml
# sudo buildah commit --cmd '/bin/bash' mycontainer centos-tripleo-image
---
- hosts: mycontainer
connection: buildah
tasks:
@sshnaidm
sshnaidm / tripleo_container_manage.yaml
Last active April 23, 2020 20:48
Run tripleo container management playbook
- hosts: localhost
gather_facts: false
become: true
vars:
step: 1
enable_debug: true
tasks:
- name: Deploy HAproxy container
environment:
TRIPLEO_MINOR_UPDATE: '{{ tripleo_minor_update | default(false) }}'
@sshnaidm
sshnaidm / standalone_centos8.sh
Created April 23, 2020 20:39
Script for running standalone on CentOS 8
#!/bin/bash
export IP=$(ip addr list eth0 |grep "inet " |cut -d' ' -f6|cut -d/ -f1)
export NETMASK=22
export INTERFACE=eth1
sudo ip r a 192.168.122.0/24 via 192.168.121.1
# cleanup
rm -rf $HOME/containers-prepare-parameters.yaml $HOME/standalone_parameters.yaml
@sshnaidm
sshnaidm / tr-images.yaml
Created December 2, 2019 15:01
medium_transible2
images:
- name: new_image
owner: ....
min_disk: 20
is_public: false
filename: /v2/images/...hash.../file
- name: cloud-image
checksum: ....
owner: ....
min_disk: 8
@sshnaidm
sshnaidm / tr-playbook.yaml
Created December 2, 2019 15:00
medium_transible1
---
- os_image:
name: '{{ name | default(omit) }}'
owner: '{{ owner | default(omit) }}'
filename: '{{ filename | default(omit) }}'
min_disk: '{{ min_disk | default(omit) }}'
disk_format: '{{ disk_format | default(omit) }}'
properties: '{{ properties | default(omit) }}'
cloud: my-cloud
checksum: '{{ checksum | default(omit) }}'
@sshnaidm
sshnaidm / list_cached_squid_files.sh
Created November 19, 2019 23:35
List all cached files in squid
find /var/spool/squid -type f | xargs -i{} head -1 {} | grep -oa "http.*"
@sshnaidm
sshnaidm / inventory.ini
Last active June 12, 2019 16:01
Ansible podman testing
test ansible_host=test ansible_connection=podman