Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Ansible collection to the newest version #38

Merged
merged 8 commits into from
Jun 24, 2024

Conversation

filip-szweda
Copy link
Contributor

@filip-szweda filip-szweda commented Jun 13, 2024

Changes

Requirements

  • Dynatrace-OneAgent-Ansible now requires Ansible >= 2.15.0 (declared in readme, requirements.txt, meta/runtime.yml)
  • pywinrm >= 0.4.1 is only required on Windows

Porting

  • explicitly declared unique filter as case insensitive (source)
  • added bool filter wherever needed (source)
    • Note to Reviewers: Should I filter through bool all variables, which should be booleans?

Fixes

  • placed ansible.builtin.include_tasks outside other tasks
  • updated how lists are defined
  • removed > from variable: > (previous approach caused unnecessary \n to appear)

Readme

  • added Requirements section with General and Windows subsections
  • added Setup section
  • added Build section
  • extended Installation section

.gitignore

  • built collections are now ignored

Playbooks used in testing

Installation with downloaded installer

---
- name: >
    Download and install
  hosts: localhost
  connection: local 
  collections:
    - dynatrace.oneagent
  vars:
    oneagent_package_state: present
    ansible_become: true
    oneagent_download_dir: <download_dir>
    oneagent_environment_url: <environment_url>
    oneagent_paas_token: <token>
    
  tasks:
    - name: Import Dynatrace OneAgent role
      ansible.builtin.import_role:
        name: oneagent

Installation

---
- name: >
    Install
  hosts: localhost
  connection: local 
  collections:
    - dynatrace.oneagent
  vars:
    oneagent_package_state: present
    ansible_become: true
    oneagent_download_dir: /home/labuser
    oneagent_local_installer: /home/labuser/Dynatrace-OneAgent-Ansible/Dynatrace-OneAgent-Linux-<version>.sh
    
  tasks:
    - name: Import Dynatrace OneAgent role
      ansible.builtin.import_role:
        name: oneagent

oneagentctl configuration

---
- name: >
    Configure
  hosts: localhost
  connection: local 
  collections:
    - dynatrace.oneagent
  vars:
    oneagent_package_state: present
    ansible_become: true
    oneagent_install_args:
      - --set-host-name=new_host_name
      - --set-host-tag=new_tag
      - --set-host-property=property1
      - --set-host-property=other=property
    
  tasks:
    - name: Import Dynatrace OneAgent role
      ansible.builtin.import_role:
        name: oneagent

Uninstallation

---
- name: >
    Uninstall
  hosts: localhost
  connection: local 
  collections:
    - dynatrace.oneagent
  vars:
    oneagent_package_state: absent
    ansible_become: true
    
  tasks:
    - name: Import Dynatrace OneAgent role
      ansible.builtin.import_role:
        name: oneagent

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
roles/oneagent/README.md Outdated Show resolved Hide resolved
roles/oneagent/tasks/provide-installer/download-unix.yml Outdated Show resolved Hide resolved
roles/oneagent/vars/aix.yml Show resolved Hide resolved
@WStechura WStechura closed this Jun 19, 2024
@WStechura WStechura reopened this Jun 19, 2024
roles/oneagent/README.md Outdated Show resolved Hide resolved
@filip-szweda filip-szweda merged commit 903e3a9 into master Jun 24, 2024
1 check passed
@filip-szweda filip-szweda deleted the upgrade-ansible-collection-to-the-newest-version branch June 24, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants