This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ModuleArgs are the module inputs | |
type ModuleArgs struct { | |
Time string | |
} | |
func main() { | |
... | |
argsFile := os.Args[1] | |
text, err := ioutil.ReadFile(argsFile) | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isItBusy(min string) (bool, error) { | |
... | |
// max -> min.Add(1 * time.Hour) | |
max, err := maxTime(min) | |
// ... | |
srv, err := calendar.New(client) | |
// ... | |
freebusyRequest := calendar.FreeBusyRequest{ | |
TimeMin: min, | |
TimeMax: max, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Run Go container | |
podman_container: | |
name: go_test_container | |
image: golang | |
command: go version | |
rm: true | |
log_options: "path={{ log_file }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks: | |
- shell: echo "Run this only when not busy!" | |
when: not output.busy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ok: [localhost] => { | |
"output": { | |
"busy": true, | |
"changed": false, | |
"failed": false, | |
"msg": "The timeslot 2020-09-02T17:53:43Z is busy: true" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Check if timeslot is taken | |
calendar: | |
time: "{{ ansible_date_time.iso8601 }}" | |
register: output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Wait until we can SSH to the target from the Test Host | |
wait_for: | |
host: "{{ ansible_host }}" | |
port: 22 | |
state: started | |
timeout: 30 | |
delegate_to: "{{ test_host }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Run Capirca Module | |
nleiva.capirca_acl.translate: | |
platform: 'iptables' | |
filter_options: | |
- 'INPUT' | |
- 'ACCEPT' | |
def_folder: "sample" | |
pol_file: "sample/terms.pol" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks: | |
- name: Save current iptables rules | |
shell: iptables-save > /tmp/iptables-rules-backup.txt | |
- name: Schedule iptables-restore to execute in 20 minutes as root | |
at: | |
command: iptables-restore < /tmp/iptables-rules-backup.txt | |
count: 20 | |
units: minutes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vars: | |
map: | |
ios: "cisco" | |
junos: "juniper" | |
CentOS: "iptables" | |
RedHat: "iptables" | |
tasks: | |
- name: Set platform for Networking devices | |
set_fact: |