Skip to content

Commit

Permalink
add update option
Browse files Browse the repository at this point in the history
  • Loading branch information
molecule authored and tanganellilore committed Jun 4, 2024
1 parent f63fc13 commit e6952af
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion roles/podman/tasks/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
- name: Define podman_packages
ansible.builtin.set_fact:
podman_packages: "{{ __podman_packages | list }}"
when: podman_packages is not defined
when: podman_packages is not defined

Check failure on line 10 in roles/podman/tasks/variables.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
35 changes: 19 additions & 16 deletions roles/setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Run preflight
ansible.builtin.include_tasks: preflight.yml
ansible.builtin.include_tasks: preflight.yml

Check failure on line 3 in roles/setup/tasks/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces

# Variable configuration.
- name: Include variables
Expand All @@ -15,7 +15,7 @@
ansible.builtin.set_fact:
additional_python_packages: "{{ additional_python_packages + ['receptorctl'] }}"
when:
- receptor_install_method in ['release', 'local']
- receptor_install_method in ['release', 'update-release', 'local','update-local']
- "'receptorctl' not in additional_python_packages"

- name: Install python packages
Expand All @@ -24,11 +24,11 @@

- name: Receptor install local
ansible.builtin.include_tasks: setup-local.yml
when: receptor_install_method == 'local'
when: receptor_install_method in ['local', 'update-local']

- name: Receptor install release
ansible.builtin.include_tasks: setup-release.yml
when: receptor_install_method == 'release'
when: receptor_install_method in ['release', 'update-release']

- name: Check if receptor was installed correctly
ansible.builtin.command: "receptor --version"
Expand All @@ -43,28 +43,31 @@
fail_msg: "Receptor not installed correctly. Please check the installation or reinstall it with local_receptor: true"
success_msg: "Receptor installed correctly"

- name: Configure receptor socket
ansible.builtin.include_tasks: configure.yml
- name: Configuration tasks during fisrt installation
when: "'update' not in receptor_install_method"
block:
- name: Configure receptor socket
ansible.builtin.include_tasks: configure.yml

- name: TLS files
ansible.builtin.include_tasks: tls.yml
when: receptor_tls
- name: TLS files
ansible.builtin.include_tasks: tls.yml
when: receptor_tls

- name: Work signing
ansible.builtin.include_tasks: worksign.yml
when: receptor_sign or receptor_verify
- name: Work signing
ansible.builtin.include_tasks: worksign.yml
when: receptor_sign or receptor_verify

- name: Generate receptor config
ansible.builtin.include_tasks: generate_config.yml
- name: Generate receptor config
ansible.builtin.include_tasks: generate_config.yml

- name: Setup systemd
ansible.builtin.include_tasks: setup-service.yml
when: receptor_install_method in ['release', 'local']
when: receptor_install_method in ['release', 'local', 'update-release', 'local','update-local']

- name: Start Receptor service
ansible.builtin.systemd:
name: "{{ receptor_service_name }}"
state: started
state: 'started'

Check failure on line 70 in roles/setup/tasks/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
daemon_reload: true
enabled: true
register: _started
2 changes: 1 addition & 1 deletion roles/setup/tasks/preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- name: Check local binary file is set
ansible.builtin.assert:
that: receptor_local_bin_file | length
when: receptor_install_method == 'local'
when: receptor_install_method in ['local', 'update-local']

Check failure on line 5 in roles/setup/tasks/preflight.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[colons]

Too many spaces after colon
1 change: 1 addition & 0 deletions roles/setup/tasks/python_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- name: Install additional python packages
ansible.builtin.pip:
name: "{{ additional_python_packages | default([]) }}"
state: "{{ 'latest' if 'update' in receptor_install_method else 'present' }}"

Check failure on line 21 in roles/setup/tasks/python_packages.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
executable: "{{ pip_executable }}"

- name: Symlink receptorctl to /usr/bin
Expand Down
2 changes: 1 addition & 1 deletion roles/setup/tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- name: Install dependencies specific to the node type
ansible.builtin.apt:
name: "{{ additional_system_packages | default([]) }}"
state: present
state: "{{ 'latest' if 'update' in receptor_install_method else 'present' }}"
4 changes: 2 additions & 2 deletions roles/setup/tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Install receptor packages
ansible.builtin.dnf:
name: "{{ receptor_packages }}"
state: present
state: "{{ 'latest' if 'update' in receptor_install_method else 'present' }}"
when:
- receptor_install_method == 'package'
- receptor_packages
Expand Down Expand Up @@ -37,4 +37,4 @@
- name: Install dependencies specific to the node type
ansible.builtin.dnf:
name: "{{ additional_system_packages | default([]) }}"
state: present
state: "{{ 'latest' if 'update' in receptor_install_method else 'present' }}"

0 comments on commit e6952af

Please sign in to comment.