Skip to content

Instantly share code, notes, and snippets.

@wtfred
wtfred / GitlabCiAnsibleGalaxyGitRepository.md
Last active January 10, 2024 19:15
Using same requirements.yml in gitlab-ci with roles in private git repositories, using tokens

I had a problem using ansible / ansible-galaxy to install roles from a requirements.yml file.

My roles are listed like this:

- src: git+ssh://git@gitlab.domain.lan/ansible/roles/my_role.git
  version: "v1.0.0"

This is working fine when running ansible-galaxy install -r requirements.yml on a host which have permission on the role repository (with a pair of ssh keys)

In Gitlab you can't define a "Deploy key" at group level, so i needed to use a token instead.

@saiashirwad
saiashirwad / Dark-Reader-Settings.json
Created September 25, 2020 00:23
Dark Reader Chrome Settings Gruvbox
{
"applyToListedOnly": false,
"automation": "",
"changeBrowserTheme": false,
"customThemes": [
{
"url": [
"arxiv.org"
],
"theme": {
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Dynamic Ansible Inventory based on LibreNMS API access.
"""
#######################################################################
# #
# This script has been superseded by: #
@kd7lxl
kd7lxl / librenms.py
Created December 19, 2018 05:27
Ansible dynamic inventory from LibreNMS
#!/usr/bin/env python
import json
import urllib2
librenms = json.loads(
urllib2.urlopen(urllib2.Request(
'https://librenms.hamwan.org/api/v0/devices',
headers={'X-Auth-Token': ''},
#!/usr/bin/bash
which ansible >/dev/null 2>&1
if [ $? -ne 0 ];
then
echo "Installing Ansible..."
sleep 5
pushd .
cd ~
pacman -S libyaml-devel python2 tar libffi libffi-devel gcc pkg-config make openssl-devel openssh libcrypt-devel --noconfirm --needed
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
@Bharat-B
Bharat-B / hostname.conf
Created February 23, 2018 08:22
WHMCS nGINX rules for SSL / Non SSL
### NON SSL | STANDARD HTTP
server {
listen 80;
server_name domain.com;
root /path/to/whmcs;
index index.php index.html;
access_log /var/log/nginx/domain.com.log combined;
access_log /var/log/nginx/domain.com.bytes bytes;
error_log /var/log/nginx/domain.com.error.log error;
location / {
@awfki
awfki / netbox-ansible.py
Created October 26, 2017 13:43 — forked from linuxsimba/netbox-ansible.py
Ansible Netbox Integration Example
#!/usr/bin/python
""" Ansible Inventory Generated From Netbox
Author: Stanley Karunditu <stanley@linuxsimba.com>
License: MIT
Requirements:
* use netbox device roles that result in hyphenated role names. E.g
@fourkbomb
fourkbomb / osrc_download.py
Created September 28, 2017 02:42
download source releases from samsung OSRC using a terminal
#!/usr/bin/env python3
# Copyright (c) 2017 Simon Shields
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@Brainiarc7
Brainiarc7 / transient-clustering-gnu-parallel-sshfs.md
Last active April 21, 2024 05:16
How to set up a transient cluster using GNU parallel and SSHFS for distributed jobs (such as FFmpeg media encodes)

Transient compute clustering with GNU Parallel and sshfs:

GNU Parallel is a multipurpose program for running shell commands in parallel, which can often be used to replace shell script loops,find -exec, and find | xargs. It provides the --sshlogin and --sshloginfile options to farm out jobs to multiple hosts, as well as options for sending and retrieving static resources and and per-job input and output files.

For any particular task, however, keeping track of which files need to pushed to and retrieved from the remote hosts is somewhat of a hassle. Furthermore, cancelled or failed runs can leave garbage on the remote hosts, and if input and output files are large, sending them to local disk on the remote hosts is somewhat inefficient.

In a traditional cluster, this problem would be solved by giving all nodes access to a shared filesystem, usually with NFS or something more exotic. However, NFS doesn't wo

@nazarewk
nazarewk / ansible.cfg
Last active August 2, 2021 20:27
Ansible SSH Agent forwarding with Jump (bastion) host
[defaults]
sudo_flags = SSH_AUTH_SOCK="$SSH_AUTH_SOCK" -H -S -n
[ssh_connection]
ssh_args=-o ForwardAgent=yes