- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
- using inventory:
127.0.0.1 ansible_connection=local
ansible-playbook --connection=local 127.0.0.1 playbook.yml
127.0.0.1 ansible_connection=local
import org.yaml.snakeyaml.Yaml | |
new Yaml().load(new FileReader('path/to/your/yaml/file')) | |
// and do whatenver your want with the returned map |
By default, sudo
on the Linux systems executes commands into a minimal environment. So, if you for example has some non-standard directories (such as /opt/groovy/bin
)
added to your PATH
, a command running via sudo
won't see any executable in these directories.
Normally, this strict sudo
behavior can be changed by removing env_reset
(or changing env_keep
) variables in /etc/sudoers
.
But what can you do in case when you have only restricted sudo
without write access to this file?
The following command passes a current value of PATH
under a command run with sudo
privileges:
sudo bash -c "export $PATH; which groovy"
#!/bin/bash | |
PATTERN='for-example-a-kafka-topic-name-to-look-for' | |
for ns in $(kubectl get ns | awk '{if ($1 !~ /^NAME|kube-/) {print $1}}') | |
do | |
echo "Looking into $ns" | |
kubectl exec -n "$ns" -c nifi nifi-0 -- zgrep "$PATTERN" permanent_configs/flow.xml.gz 2>/dev/null | |
done |
pipeline { | |
agent { | |
label 'Linux' | |
} | |
stages { | |
stage('ask') { | |
steps { | |
script { | |
def askpass = input( | |
message: 'Please enter the password', |
#!/bin/bash | |
ANSIBLE_ROOT=${ANSIBLE_ROOT:-/opt/ansible} | |
DISTR_ROOT=${DISTR_ROOT:-/vagrant} | |
yum install -y python-setuptools python-devel libffi-devel openssl-devel | |
easy_install virtualenv | |
virtualenv "$ANSIBLE_ROOT" | |
. "$ANSIBLE_ROOT/bin/activate" | |
# PY_LIBS can contain a space-separated list of Python libraries your playbooks require to run (e.g., "dnspython shade") |
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment | |
fieldalignment -fix a_problematic_file.go |
Github
(under it, set up endpoint, credentials, repo name, etc.);<your-jenkins-host>/github-webhook/
and select pull request event
under Let me select individual events option;continuous-integration/jenkins/pr-merge
under itimport javax.naming.directory.* | |
MYDOM = 'example.com' | |
// convert DNS domain to a LDAP notation | |
dns2ldap = {dom -> | |
'DC=' + dom.split(/\./).join(',DC=') | |
} | |
// base OU for our search |
#!/bin/sh -e | |
# Install a Terraform provider | |
OS=linux | |
ARCH=amd64 | |
OPTS=`getopt -l dont-unzip,full-url:,group:,provider:,site:,url:,version: -- df:g:p:u:s:v: "$@"` || exit 1 | |
eval set -- "$OPTS" |