Sha256: 0e8fb3fa94b470f37d63165d36bc6b27cc43edf2633718f2e06f511f3db2c248

Contents?: true

Size: 1.58 KB

Versions: 31

Compression:

Stored size: 1.58 KB

Contents

<%#
name: Smart Proxy Upgrade Playbook
snippet: false
template_inputs:
- name: target_version
  required: false
  input_type: user
  advanced: false
  value_type: plain
  hidden_value: false
- name: whitelist_options
  required: false
  input_type: user
  advanced: false
  value_type: plain
  hidden_value: false
model: JobTemplate
job_category: Maintenance Operations
description_format: "%{template_name}"
provider_type: Ansible
kind: job_template
feature: ansible_run_smart_proxy_upgrade
%>

---
- hosts: all
  vars:
    target_version: "<%= input('target_version').present? ? input('target_version') : product_short_version %>"
  tasks:
    - name: Gather the rpm package facts
      package_facts:
        manager: auto

    - name: Fail if the target server is a Foreman server
      fail:
        msg: "This playbook cannot be executed on a Foreman server. Use only on a Smart Proxy server."
      when: "'foreman' in ansible_facts.packages"

    - name: Install foreman release gpg key
      rpm_key:
        state: present
        key: http://yum.theforeman.org/releases/{{ target_version }}/RPM-GPG-KEY-foreman
      when: target_version != "nightly"

    - name: Update foreman repositories
      package:
        name: https://yum.theforeman.org/releases/{{ target_version }}/el{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/foreman-release.rpm
        state: installed

    - name: Clean yum metadata
      command: yum clean all

    - name: Update all packages
      package:
        name: '*'
        state: latest

    - name: Run the installer
      shell: foreman-installer

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
foreman_ansible-15.0.2 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-15.0.1 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-15.0.0 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-14.2.2 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-14.2.1 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.7 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-14.2.0 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-14.1.1 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-14.1.0 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.5 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-14.0.0 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.4 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.3 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.2 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.1 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-13.0.0 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-12.0.7 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-10.4.4 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-12.0.6 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb
foreman_ansible-12.0.5 app/views/foreman_ansible/job_templates/smart_proxy_upgrade_-_ansible_default.erb