Skip to content

Instantly share code, notes, and snippets.

injectors:
extra_vars:
vcentre_host: "{% raw %}{ {vcentre_host }}{% endraw %}"
vcentre_loginusername: "{% raw %}{ { vcentre_username }}{% endraw %}"
vcentre_password: "{% raw %}{ { vcentre_password }}{% endraw %}"
extra_vars:
vcentre_host: '{ {vcentre_host }}'
vcentre_loginusername: '{ { vcentre_username }}'
vcentre_password: '{ { vcentre_password }}'
@weiyentan
weiyentan / Gitlab pipeline code excerpt
Created August 30, 2020 03:45
Gitlab pipeline list
execute_win_soe_wineventlog:
only:
refs:
- master
variables:
- $CI_COMMIT_TITLE =~ /^winsoe_wineventlog.*/
image: bydos33/awx-cli:latest
stage: winsoe
tags:
- configuration
$servers = import-csv c:\temp\servers.csv
foreach ($server in $servers){
Invoke-WindowsDeploymentCommonTask -computername $server.name -type $server.type
Invoke-SQLDeploymenttask -computername $server.name -conmfigurationtype $server.type
}
#!/usr/bin/python
# Make coding more python3-ish, this is required for contributions to Ansible
from __future__ import (absolute_import, division, print_function)
from turtle import delay
__metaclass__ = type
from ansible.errors import AnsibleError, AnsibleConnectionFailure
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
from datetime import datetime, timedelta
from time import sleep
def do_until_success_timeout(self, duration_hrs , wait):
starttime = datetime.utcnow
result = {}
patchingstatus = 'inprogress'
max_end_time = datetime.utcnow() + timedelta(hours=duration_hrs)
while datetime.utcnow < max_end_time :
try:
module_return = self._execute_module(module_name='win_apfwcompliance', module_args=module_args, task_vars=task_vars, tmp=tmp)
except:
if isinstance(e, _ReturnResultException):