Git Product home page Git Product logo

veeam-ansible's People

Contributors

carceneaux avatar vmarkusk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

veeam-ansible's Issues

TASK [veeamhub.veeam.veeam_vas : Starting all Veeam services]

Describe the bug
The task is unable to be completed successfully.
"Starting all Veeam services" for installing Veeam

To Reproduce
Steps to reproduce the behavior:
My playbook

  • name: Veeam Backup Enterprise Manager Install
    gather_facts: no
    hosts: all
    tasks:
    • include_role:
      name: veeamhub.veeam.veeam_vas
      tasks_from: em_install
      vars:
      version: "12"
      iso_download: true
      license: true
      source_license: "/opt/veeam/license.lic"
      sql_install_username: "sql_install"
      sql_install_password: "ChangeM3!"
      sql_service_username: "svc_sql"
      sql_service_password: "ChangeM3!"
      sql_username: "postgres"
      sql_password: "ChangeM3!"

Expected behavior
My playbook fails on TASK [veeamhub.veeam.veeam_vas : Starting all Veeam services].

Screenshots
Error
image
image
image

Windows event viewer
image
image

Desktop (please complete the following information):

  • OS: Had the same issue on Windows server 2019 and Windows server 2022
  • Version: 12

Additional context
If I run the exact same play after the fact it has no issues. I'm hoping someone might be able to help me find what is causing this error.

The play

  • name: Start Veeam services
    gather_facts: no
    hosts: all
    tasks:
    • name: Starting all Veeam services
      ansible.windows.win_shell: |
      Get-Service veeam* | Where-Object {$_.Name -ne "VeeamMBPDeploymentService"} | Start-Service

Unable to publish collection to Ansible Galaxy

Describe the bug
A clear and concise description of what the bug is.

When attempting to publish the latest version of this project's collection, it errs out:

Publishing collection artifact '/home/runner/work/veeam-ansible/veeam-ansible/veeamhub-veeam-1.3.1.tar.gz' to default https://galaxy.ansible.com/api/
Collection has been published to the Galaxy server default https://galaxy.ansible.com/api/
Waiting until Galaxy import task https://galaxy.ansible.com/api/v2/collection-imports/14054/ has completed
ERROR! Galaxy import process failed: 'requires_ansible' in meta/runtime.yml is mandatory, but no meta/runtime.yml found (Code: None)
Error: Process completed with exit code 1.

Expected behavior

Ansible Collection to publish without error to Ansible Galaxy.

Screenshots

image

Fix Ansible Galaxy automated deployment

Describe the bug

A GitHub Action is used to deploy the this collection to Ansible Galaxy. This action is currently failing.

Error message shown:

ERROR! Error when finding available api versions from default (https://galaxy.ansible.com/) (HTTP Code: 403, Message: Forbidden)

Expected behavior

Collection should deploy to Ansible Galaxy without error.

Additional context

Given the error message, the GitHub Action most likely needs to be updated.

Custom Installation Directory?

Is your feature request related to a problem? Please describe.

Currently, the Veeam-Hub ansible module does not allow users to specify their own installation directory during installation, which may cause conflicts with existing software or custom directory structures.

Describe the solution you'd like:

Add a parameter to the Veeam-Hub ansible module that allows users to specify their own installation directory during installation. This will provide greater flexibility and control for users during the installation process.

Describe alternatives you've considered:

The only alternative is to manually install each veeam package and specify the installation directory during installation. However, this defeats the purpose of using an automated tool like ansible.

Additional context:

This feature would be especially useful for users with custom directory structures or existing software that may conflict with the default installation directory.

Add Auto Reboot var

install_VBR.yml

- name: Checking OS for pending reboots
  block:
    - name: "Check for pending reboots"
      pending_reboot_check:
      register: precheck
      failed_when: "(precheck.pending_reboot | bool) and (auto_reboot == 'no')"

- name: Handle pending reboots and initiate reboot if necessary
  block:
    - name: "Reboot if necessary"
      ansible.windows.win_reboot:
        test_command: 'exit (Get-Service -Name Netlogon).Status -eq "Running"'
      retries: 5
      delay: 60
      until: 'test_command_result.rc == 0'
  when: precheck | bool

- name: Display message if pending reboot
  debug:
    msg: "Pending reboot, Auto reboot set to no"
  when: precheck.pending_reboot | bool and auto_reboot == 'no'

Example Playbook :

- name: Veeam Backup & Replication Install
  hosts: vbr
  tasks:
    - include_role:
        name: veeamhub.veeam.veeam_vas
        tasks_from: vbr_install
      vars:
        version: "12"
        auto_reboot: "yes"
        sql_install_username: 'sql_install'
        sql_install_password: 'windows_password'
        sql_service_username: 'svc_sql'
        sql_service_password: 'windows_password'
        sql_username: 'postgres'
        sql_password: 'linux_password'

Update sample playbook to include pause

Describe the bug

The below playbooks need to be updated to include a pause between the VBR install and applying PostgreSQL performance tuning. As is, this step will most likely fail as the server has just rebooted and Veeam services haven't been started yet.

Expected behavior

Sample playbooks should not fail.

Screenshots

CleanShot 2023-06-22 at 10 19 56@2x

License path for execution environment

          @kbreit-insight You're most likely experiencing a different error. Please check the log specified in the error for more details.

Using the default folder it's: C:\install\logs\BackupServer. log

Looking at your playbook, your source_license parameter is most likely to blame. It needs to be a fully qualified path.

For example:

source_license: "/root/ansible/license.lic"

Please open a new issue if you require further assistance.

Originally posted by @carceneaux in #43 (comment)

I am trying to understand what this should be when the playbook is run via an execution environment.

Do you plan to expand the functionality of this module?

Do you plan to expand the functionality of this module?
In addition to installation, I would like to see the possibility of setting up infrastructure components. While have to make do with powershell calls:

- name: Add vCenter
  ansible.windows.win_powershell:
    script: |
      Add-VBRvCenter -Name "vc.domain.local" -User "[email protected]" -Password "" -Description "Mega Lab VC"

- name: Add Windows credentials
  ansible.windows.win_powershell:
    script: |
      Add-VBRCredentials -User ".\Administrator" -Password "Pa$$w0rd11" -Description "Veeam Windows Service Account"

- name: Add Windows server
  ansible.windows.win_powershell:
    script: |
      Add-VBRWinServer -Name 192.168.1.24 -Description "Windows File & VMware Proxy" -Credentials (Get-VBRCredentials -name ".\Administrator") -ErrorAction Stop | Out-Null

- name: Add Windows proxy
  ansible.windows.win_powershell:
    script: |
      Add-VBRViProxy -Server 192.168.1.24

- name: Add Linux credentials
  ansible.windows.win_powershell:
    script: |
      Add-VBRCredentials -type Linux -User "root" -Password "Pa$$w0rd11" -Description "Veeam Linux Service Account"

- name: Add Linux server
  ansible.windows.win_powershell:
    script: |
      Add-VBRLinux -Name 192.168.1.14 -Description "Linux VMware Proxy" -Credentials (Get-VBRCredentials -name "root") -ErrorAction Stop | Out-Null 

- name: Add Linux proxy
  ansible.windows.win_powershell:
    script: |
      Add-VBRViLinuxProxy -Server 192.168.1.14

Avoid downloading the ISO file every time

  • name: Download ISO
    ansible.windows.win_get_url:
    url: "{{ iso_url }}"
    dest: "{{ destination }}{{ destination_iso_file }}"
    checksum: "{{ iso_checksum }}"
    checksum_algorithm: sha256
    force: true

Foce: true is the default, but it means that every time the procedure downloads the entire file. Since it's almost 10GB, this is a huge waste of time in my opinion. In my local clone I edited the line to set force:false, we should consider to have this behavior as the new default.

Playbook failed to install Veeam Backup & Replication 12 with 3 modes

Hello,
Playbook failed to install Veeam Backup & Replication 12 with 3 modes:
with remote SQL Server
or
with local Postgres
or
with remote Postgres

for example:

env:
Deployed Postgres Server version: 11
Postgres ssl auth: disabled
Pgadmin4 successfully connects to postgres server via 5432 port with below creds

connection string:
Server=bpaveeampostgres.postgres.database.azure.com;Database={your_database};Port=5432;User Id=sa@bpaveeampostgres;Password={your_password};

Veeam Backup & Replication Install with ISO Download and remote PostgreSQL (v12+):

playbook:

  • name: Veeam Backup & Replication Install
    hosts: windows
    tasks:
    • include_role:
      name: veeamhub.veeam.veeam_vas
      tasks_from: vbr_install
      vars:
      version: "12"
      iso_download: true
      sql_express_setup: false
      sql_instance: "bpaveeampostgres.postgres.database.azure.com"
      sql_username: "sa@bpaveeampostgres"
      sql_password: "XXXXXXXXX"
    • name: Applying tuning on a remote PostgreSQL server running as the VBR DB
      veeamhub.veeam.veeam_vbr_set_postgres_database_server_limits:
      os_type: Windows
      cpu_count: 16
      ram_gb: 30

I am getting error:
"msg": "unexpected rc from 'C:\Windows\System32\msiexec.exe /i G:\Backup\Server.x64.msi /LV C:\Users\adminuser\AppData\Local\Temp\ansible-moduletmp-133221485716370249-1035159283\msiexec.log /qn /norestart /Lv "C:\install\logs\\BackupServer.log" VBR_SQLSERVER_AUTHENTICATION=1 VBR_LICENSE_FILE="C:\install\vbr-license.lic" VBR_SQLSERVER_ENGINE="1" VBR_SQLSERVER_SERVER="bpaveeampostgres.postgres.database.azure.com" VBR_SQLSERVER_DATABASE="VeeamBackup" VBR_SQLSERVER_USERNAME="sa@bpaveeampostgres" VBR_SQLSERVER_PASSWORD="XXXXXXXXX" ACCEPT_LICENSING_POLICY="1" ACCEPT_REQUIRED_SOFTWARE="1" ACCEPT_THIRDPARTY_LICENSES=1 ACCEPTEULA=YES': see rc, stdout, and stderr for more details",
"rc": 1603,

ps: btw Veeam 11 installed successfully with local SQL Server via playbook with
version: "11"

Support for Veeam ONE v11

Is your feature request related to a problem? Please describe.

Veeam ONE v11 install/upgrade does not work currently.

Describe the solution you'd like

Changes need to be made to add this support.

Additional context

Veeam ONE v11 install/upgrade includes updated 3rd party binaries to be installed. The current collection needs to be updated to factor in the differences in the filenames of the binaries.

personalize the Veeam job

Good morning,

I can create jobs via the role but how can I personalize the Veeam job, for example modify retention or activate vss?

Thanks you

Error when installing Veeam Backup & Replication v12

Describe the bug
When I run the playbook using roles from VeeamHub and used playbook with ISO download and installing community version of veeam and with out ISO download and installing community edition of Veeam Backup and Replication

To Reproduce
Steps to reproduce the behavior:
Installled roles - VeeamHub from ansible-galaxy
used the playbook from github

  • name: Veeam Backup & Replication Install
    hosts: all
    tasks:
    • name: Copy Veeam ISO file to Windows
      copy:
      src: "/XXXX/VeeamBackup&Replication_12.0.0.1420_20230209.iso"
      dest: "C:\Downloads\"

    • include_role:
      name: veeamhub.veeam.veeam_vas
      tasks_from: vbr_install
      vars:
      version: "12"
      destination: "C:\Downloads\"
      destination_iso_file: "VeeamBackup&Replication_12.0.0.1420_20230209.iso"
      sql_install_username: "sql_install"
      sql_install_password: "PassW0rd!"
      sql_service_username: "svc_sql"
      sql_service_password: "PassW0rd!"
      sql_username: "sa"
      sql_password: "PassW0rd!"

Screenshots

image

Operating system used for Veeam Installation

  • OS: Windows server 2019

Could anyone solve this issue

Unhandled exception which may be related to having no backups scheduled?

Is your feature request related to a problem? Please describe.

  • On a test server with EM and VBR co-located, ran into the following error when there were no scheduled backups:

Pertinent code:

- name: Stopping all Veeam Backup Jobs (Only if VBR installed on same server as EM)
  ansible.windows.win_shell: |
    if (-Not (Get-Module -ListAvailable -Name Veeam.Backup.PowerShell)){Add-PSSnapin -PassThru VeeamPSSnapIn -ErrorAction Stop | Out-Null}
    Get-VBRJob | Stop-VBRJob | Out-Null
  # when: software.installed | bool

Pertinent error:

"stderr_lines": [
        "Get-VBRJob : Execution environment cannot be initialized to Remote",
        "At line:2 char:1",
        "+ Get-VBRJob | Stop-VBRJob | Out-Null",
        "+ ~~~~~~~~~~",
        "    + CategoryInfo          : NotSpecified: (:) [], Exception",
        "    + FullyQualifiedErrorId : System.Exception"
    ],

Describe the solution you'd like
I am not 100% sure if the root cause of this is not having backups enabled, but that's my suspicion.

Describe alternatives you've considered
Make this step optional by creating a parameter to enable or disable it in the group vars.

Additional context
For the time being I added a 'when: false' directive to disable this feature.

Switch to SHA1 checksum

This was brought up in #45.

Only MD5 and SHA1 checksums are available on Veeam's website. As such, I need to make the following changes:

  • Change default checksum to SHA1
  • Make checksum configurable
    • This enables checksum to be validated for custom ISO downloads.

When database is not installed locally, consider another mechanism to trigger DB backup

Is your feature request related to a problem? Please describe.

  • On a server where the database was provided as a service by the DBA team instead of locally, the ad hoc backup failed because the related tools were not installed:

Pertinent Code:

- name: Start adhoc EM database backup to default SQL backup location
  ansible.windows.win_shell: |
    $secureString = ConvertTo-SecureString "{{ sql_password }}" -AsPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential ("{{ sql_username }}", $secureString)
    Backup-SqlDatabase -ServerInstance "{{ sql_instance }}" -Database "{{ sql_database }}" -Credential $credential
  no_log: true

Pertinent Error:

PS C:\windows\system32> Backup-SqlDatabase
Backup-SqlDatabase : The term 'Backup-SqlDatabase' is not recognized as the
name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ Backup-SqlDatabase
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Backup-SqlDatabase:String) [],
   CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Describe the solution you'd like
I wonder if perhaps this should be configurable, perhaps there's a way to trigger the backup remotely (we rely on our DBA team to do the backups), or perhaps we can prompt the user to let them know that an SQL backup is advised but not possible with this set of tools?

Describe alternatives you've considered
Making this step configurable with a parameter defined in group_vars.

Additional context
I'm not sure how to trigger this remotely, I will seek advice from the DBA team.

Thank you!

Not working with Ansible 2.10

Describe the bug

Ansible 2.10 brought about a major architectural change. Certain common modules and roles that were built-in to previous versions of Ansible are no longer included by default. There are Roles and Modules included in this Ansible collection in this repository that need to be updated to support this new behavior.

Expected behavior

Ansible collection should work in versions 2.9.x and 2.10.x.

Additional context

Collection works fine in 2.9 but needs to be updated to support 2.10.

will it be able to create backupjobs with tag from vmware

Atm it seems that you can add alot of vms within.
plugins/modules/veeam_vbr_rest_jobs_manage.py

but is it the veeam api that doesnt support to add a tag from vmware to the backupjob or is it not implmented in the veeam-ansible plugin yet?

Add support for optional VBR plugins

Currently, optional VBR plug-ins (see below) are not managed in this Ansible collection.

  • AWS Plug-in for Veeam Backup & Replication
  • Microsoft Azure Plug-in for Veeam Backup & Replication
  • Google Cloud Platform Plug-in for Veeam Backup & Replication
  • Veeam Backup for Nutanix AHV

This is a FR to add support for these items including install/patch/upgrade tasks.

Dependencies need updated

Describe the bug
Attempted to update the collection using community-general-ansible-galaxy-install-module, which doesn't actually handle failures very well. I had previously installed the collection manually without incident, latest being v1.3.2. On researching the failure, it appears there are dependencies that have since been updated.
According to your manifest:
"dependencies": {
"ansible.windows": "1.7.3",
"community.windows": "1.7.0"
Both of those are now at v1.9.0.

We've not yet actually used this collection, but is definitely in scope for us for the future.
Thanks.

To Reproduce
Here's the main update task:
- name: install and update shared collections
community.general.ansible_galaxy_install:
ack_ansible29: yes
type: collection
dest: /srv/ansible/collections
force: yes
requirements_file: /srv/ansible/playbooks/ulcollections.yml
register: installed

If veeamhub.veeam is included in the requirements file, it fails due to unable to satisfy the dependencies.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Error sometimes when starting Veeam services

Receiving the following error sometimes:

non-zero return code

CleanShot 2023-02-15 at 09 18 20

When executing the following Ansible code located in vbr_upgrade.yml:

- name: Ensure Veeam services are running
  ansible.windows.win_shell: |
    Get-Service veeam* | Start-Service -ErrorAction SilentlyContinue

While I'd expect the ErrorAction param to negate this behavior, this is not the case. Need to update code to the following to resolve this issue:

- name: Ensure Veeam services are running
  ansible.windows.win_shell: |
    Get-Service veeam* | Where-Object {$_.Name -ne "VeeamMBPDeploymentService"} | Start-Service

Get-AnsibleWindowsWebRequestSpec module missing error

Describe the bug
at the Download_ISO task the playbook is failing with the message The term 'Get-AnsibleWindowsWebRequestSpec' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:51 char:65

Desktop (please complete the following information):

  • OS: Windows Server 2019
    veeam

My Ansible version is: 2.9.6

VeeamBackupCatalog not upgradable if not installed

Is your feature request related to a problem? Please describe.

Upgrading from 11 to 11A with the EM and VBR upgrades, encountered the following issues:

  • On the test and development servers, the Backup Catalog was not installed, which caused the upgrade to fail as it attempted to upgrade a feature that was not installed.

Pertinent excerpt:

"msg": "unexpected rc from 'C:\\windows\\System32\\msiexec.exe /i E:\\Catalog\\VeeamBackupCatalog64.msi

Describe the solution you'd like
Detect whether an upgrade to the VeeamBackupCatalog is necessary, and only proceed if it is.

Describe alternatives you've considered
A parameter to enable/disable the installation of the VeeamBackupCatalog in the group vars.

Additional context
I'm not aware of which scenarios I would install VeeamBackupCatalog on my backup server, I will have to refer to the guides to understand why this is an issue. I suspect that the scenario covered here is a smaller deployment where the backup catalog is co-resident with the VBR?

I have an environment I can test this.

Thank you!

Add ASYNC Task to monitor ISO download.

- name: Download ISO with Retry (async)
  ansible.windows.win_get_url:
    url: "{{ iso_url }}"
    dest: "{{ destination }}{{ destination_iso_file }}"
    checksum: "{{ iso_checksum }}"
    checksum_algorithm: sha256
    force: true
  retries: 3
  delay: 10
  async: 600 
  poll: 0   
  register: win_get_url_out
  when: (iso_file_info.matched | int) == 0

- name: Check download task status
  async_status:
    jid: "{{ win_get_url_out.ansible_job_id }}"
  register: job_result
  until: job_result.finished
  retries: 60  
  delay: 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.