vcf_vc_patch

State module for vCenter’s VAMI appliance-update REST API (VCSA self-patching).

Drives the vCenter Server Appliance’s own update lifecycle: configure an update repository, stage a resolved version (idempotent — a no-op if that version is already staged), run prechecks, then install.

Inputs default from pillar saltext.vcf:vc_patch when not passed explicitly — see saltext.vcf.clients.vc_patch for the underlying REST calls.

Example:

vc-repo:
  vcf_vc_patch.repository_configured:
    - repository_url: http://repo.example.com/vcsa/

vc-staged:
  vcf_vc_patch.update_prepared:
    - version: "9.0.1.0.12345"
    - require:
      - vcf_vc_patch: vc-repo

vc-installed:
  vcf_vc_patch.update_installed:
    - version: "9.0.1.0.12345"
    - sso_password: {{ pillar['vc_sso_password'] }}
    - require:
      - vcf_vc_patch: vc-staged
saltext.vcf.states.vcf_vc_patch.repository_configured(name, repository_url=None, auto_stage=None, certificate_check=None, check_schedule=None, repo_username=None, repo_password=None, profile=None)[source]

Ensure the appliance’s update-repository policy is configured.

Not idempotency-checked — this PUT always fires; VAMI’s policy-set action is itself idempotent server-side (it fully replaces the prior policy), so re-running with the same inputs is a safe no-op in effect.

saltext.vcf.states.vcf_vc_patch.update_prepared(name, repository_url=None, version=None, component=None, monitor=None, stage_timeout_seconds=None, poll_interval_seconds=None, max_transient_errors=None, force_stage=None, run_precheck=None, profile=None, **kwargs)[source]

Ensure the resolved update version is staged on the appliance.

Idempotent: if that version is already staged, this is a no-op unless force_stage is set. A client-side timeout during staging doesn’t necessarily mean staging failed — falls back to polling get_staged_update to see if it completed anyway before treating it as an error.

saltext.vcf.states.vcf_vc_patch.update_installed(name, version=None, sso_password=None, component=None, monitor=None, install_timeout_seconds=None, poll_interval_seconds=None, max_transient_errors=None, profile=None, **kwargs)[source]

Install a previously staged update version.

Not idempotency-checked before install — only update_prepared() guards against redundant work; installing twice isn’t a safe no-op to assume, so this always proceeds once called.

saltext.vcf.states.vcf_vc_patch.installed(name, repository_url=None, version=None, sso_password=None, component=None, monitor=None, stage_timeout_seconds=None, poll_interval_seconds=None, max_transient_errors=None, force_stage=None, run_precheck=None, install_timeout_seconds=None, profile=None)[source]

Ensure version is staged and installed, in one call.

Dispatches to update_prepared() under test=True (dry-run only stages), or update_installed() for a real run. Accepts the union of both functions’ tuning parameters so a single SLS entry can drive either phase without needing two separate states.