Skip to content

Instantly share code, notes, and snippets.

- name: Set python interpreter to python 3 in Ubuntu
vars:
ansible_python_interpreter: '/usr/bin/python3'
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "14")
become: yes
vars:
internal_addresses:
- 10.0.0.0
- 172.16.0.0
tasks:
- name: debug
debug:
msg: "{{item}}"
when: "{{ hostvars[inventory_hostname]['ansible_' + item]['ipv4']['address'] is select('match', internal_addresses) }}"
firewalld_zone_interface:
- zone: internal
interface:
- eth0
- eth1
- name: test
debug:
msg: "{{ outer_item.zone }} interfaces: {{ item }}"
loop: "{{ outer_item.interface }}"
- name: Assign private interface to internal zone
firewalld:
zone: internal
interface: eth0
permanent: true
state: enabled
when: "'eth0' in ansible_interfaces"
" Automatic installation for vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
# Podio
config.podio_client_id = ENV["PODIO_CLIENT_ID"]
config.podio_client_secret = ENV["PODIO_CLIENT_SECRET"]
config.podio_username = ENV["PODIO_USERNAME"]
config.podio_password = ENV["PODIO_PASSWORD"]
# HelpScout
config.helpscout_secret_key = ENV["HELPSCOUT_SECRET_KEY"]
#!/bin/bash
# Only run if this flag is set. The flag is created by the yum-cron init
# script when the service is started -- this allows one to use chkconfig and
# the standard "service stop|start" commands to enable or disable yum-cron.
if [[ ! -f /var/lock/subsys/yum-cron ]]; then
exit 0
fi
# Action!
yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.nethub.com.hk
* epel: www.ftp.ne.jp
* extras: centos.nethub.com.hk
* updates: centos.nethub.com.hk
Resolving Dependencies
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.0-11.el7 will be updated
- name: restart named-chroot
systemd:
name: named-chroot
daemon_reload: yes
state: restarted
- name: ensure named-chroot is started
systemd:
name: named-chroot
enabled: true
#!/bin/sh
xdpyinfo -ext XINERAMA | sed '/^ head #/!d;s///' |
while IFS=' :x@,' read i w h x y; do
import -window root -crop ${w}x$h+$x+$y $HOME/tmp/head_$i.png
done