Skip to content

Instantly share code, notes, and snippets.

View georgitrifonov's full-sized avatar

Georgi Trifonov georgitrifonov

View GitHub Profile
@georgitrifonov
georgitrifonov / ansible_conditionals_examples.yaml
Created January 21, 2020 20:25 — forked from marcusphi/ansible_conditionals_examples.yaml
Ansible 1.3 Conditional Execution -- Very complete example with comments -- I find the conditional expressions to be ridiculously hard to get right in Ansible. I don't have a good model of what's going on under the surface so I often get it wrong. What makes it even harder is that there has been at least three different variants over the course …
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
@georgitrifonov
georgitrifonov / gist:b6090d2fcf705237f8c8d6e070a67fc3
Created January 12, 2020 15:01 — forked from u1735067/gist:d2b28966009d70a70928
TASK ERROR: clone failed: lvcreate 'vms/pve-vm-119' error: Failed to activate new LV.
root@camille:/etc/pve# lvcreate -L 16M -n vm-119-disk-1 vms
device-mapper: create ioctl on vms-vm--119--disk--1 failed: Device or resource busy
Failed to activate new LV.
root@camille:/etc/pve#
==> http://setaoffice.com/2015/03/25/device-mapper-create-ioctl-failed-device-or-resource-busy/
root@camille:/etc/pve#
root@camille:/etc/pve# dmsetup
Usage:
@georgitrifonov
georgitrifonov / set-ip.md
Created December 31, 2019 16:02 — forked from munim/set-ip.md
Set network IP Static/DHCP using Powershell

#How to set network IP Static/DHCP using Powershell in Windows 8 and above

This is a powershell script to set IP address for a network adapter using Powershell and restart the network adapter after it completes. Follow the below steps and detailed information about the parameters below.

Create a ps1 file using the below code

# Author: Munim (me@munim.net)
### Keybase proof
I hereby claim:
* I am georgitrifonov on github.
* I am georgitrifonov (https://keybase.io/georgitrifonov) on keybase.
* I have a public key ASADLZlSgayClbouSEvAgmMNxXSQI3rIeH3Vk8AJ5I9umAo
To claim this, I am signing this object: