Архив метки: ansible

Ansible включение тайминга выполнения задач

В Ansible можно включить тайминг времени запуска и выполнения тасок, в результате ход выполнения плейбуков приобретет подобный вид:

TASK [restore_postgres : Select target DB size (MB)]
********************************************************************************************************************
Thursday 26 September 2019 10:40:20 +0300 (0:00:00.061) 0:12:12.391 ****
ok: [bufferdb]
TASK [restore_postgres : Set DBSize to variable]
************************************************************************************************************************
Thursday 26 September 2019 10:40:21 +0300 (0:00:00.558) 0:12:12.949 ****
ok: [bufferdb]
TASK [restore_postgres : debug]
*****************************************************************************************************************************************
Thursday 26 September 2019 10:40:21 +0300 (0:00:00.060) 0:12:13.010 ****
ok: [bufferdb] => {
"msg": "Database size in MB is: 33189.0"
}

Читать далее

0

Костыли ANsible + MSSQL

Не нашел модулей для установки MSSQL, написал свой скрипт

=============================================================

Playbook  Установка MSSQL

=============================================================


— hosts: windows
tasks:

— name: Create temporary directory
win_file:
path: C:\ansible
state: directory
— name: Create temporary directory
win_file:
path: C:\tmp
state: directory
— name: Copy Config in path C:\ansible
win_copy:
src: /home/ansible/configurationfile.ini
dest: C:\ansible\ConfigurationFile.INI
— name: Copy a script mssql_install in path C:\ansible
win_copy:
src: /home/ansible/files/mount.ps1
dest: C:\ansible\mssql_install.ps1
— name: Copy ISO in path C:\tmp
win_copy:
src: /home/ansible/files/SQLServer2014SP2-FullSlipstream-x64-ENU.iso
dest: C:\tmp\SQLServer2014SP2.iso

— name: Installing MSSQL2014
win_command: PowerShell.exe «C:\ansible\mssql_install.ps1»

===================================================================
===================================================================
mssql_install.ps1

==================================================================

$beforeMount = (Get-Volume).DriveLetter
$mountResult = Mount-DiskImage C:\tmp\SQLServer2014SP2.iso
$setuppath = (compare $beforeMount (Get-Volume).DriveLetter -PassThru) + «:\setup.exe»
& $setuppath /ConfigurationFile=C:\ansible\ConfigurationFile.INI /Q

====================================================================

2+