Skip to content

Commit

Permalink
Add future version pinning to config (#585)
Browse files Browse the repository at this point in the history
* Convert to linux file endings

* Fixes #581 with correct package name

* Add version for version pinning

* Update install conditions to new var

* Update manage services to new vars
  • Loading branch information
spartan782 authored May 20, 2021
1 parent 9faf12d commit 58650c3
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 148 deletions.
2 changes: 1 addition & 1 deletion bin/rock
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,4 @@ EOF
(*) usage
exit 0
;;
esac
esac
26 changes: 13 additions & 13 deletions playbooks/deploy-rock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
become: true
roles:
- role: elasticsearch
when: "rock_services | selectattr('name', 'equalto', 'elasticsearch') | map(attribute='installed') | list | first | bool"
when: "'elasticsearch' in installed_services"

- hosts: elasticsearch
tags:
Expand All @@ -38,7 +38,7 @@
become: true
roles:
- role: elasticsearch
when: "rock_services | selectattr('name', 'equalto', 'elasticsearch') | map(attribute='installed') | list | first | bool and (es_restart is defined and es_restart)"
when: "'elasticsearch' in installed_services and (es_restart is defined and es_restart)"

- hosts: elasticsearch
tags:
Expand All @@ -53,7 +53,7 @@
become: true
roles:
- role: elasticsearch
when: "rock_services | selectattr('name', 'equalto', 'elasticsearch') | map(attribute='installed') | list | first | bool"
when: "'elasticsearch' in installed_services"

- hosts: zookeeper
tags:
Expand All @@ -64,7 +64,7 @@
become: true
roles:
- role: zookeeper
when: "rock_services | selectattr('name', 'equalto', 'zookeeper') | map(attribute='installed') | list | first | bool"
when: "'zookeeper' in installed_services"

- hosts: kafka
tags:
Expand All @@ -75,7 +75,7 @@
become: true
roles:
- role: kafka
when: "rock_services | selectattr('name', 'equalto', 'kafka') | map(attribute='installed') | list | first | bool"
when: "'kafka' in installed_services"

- hosts: stenographer
tags:
Expand All @@ -87,7 +87,7 @@
become: true
roles:
- role: stenographer
when: "rock_services | selectattr('name', 'equalto', 'stenographer') | map(attribute='installed') | list | first | bool"
when: "'stenographer' in installed_services"
stenographer_monitor_interfaces: "{{ rock_monifs }}"

- hosts: zeek
Expand All @@ -100,7 +100,7 @@
become: true
roles:
- role: zeek
when: "rock_services | selectattr('name', 'equalto', 'zeek') | map(attribute='installed') | list | first | bool"
when: "'zeek' in installed_services"

- hosts: suricata
tags:
Expand All @@ -112,7 +112,7 @@
become: true
roles:
- role: suricata
when: "rock_services | selectattr('name', 'equalto', 'suricata') | map(attribute='installed') | list | first | bool"
when: "'suricata' in installed_services"

- hosts: fsf
tags:
Expand All @@ -124,7 +124,7 @@
become: true
roles:
- role: fsf
when: "rock_services | selectattr('name', 'equalto', 'fsf') | map(attribute='installed') | list | first | bool"
when: "'fsf' in installed_services"

- hosts:
- docket
Expand All @@ -140,7 +140,7 @@
become: true
roles:
- role: lighttpd
when: "rock_services | selectattr('name', 'equalto', 'lighttpd') | map(attribute='installed') | list | first | bool"
when: "'lighttpd' in installed_services"

- hosts:
- docket
Expand All @@ -154,8 +154,8 @@
become: true
roles:
- role: docket
when: "rock_services | selectattr('name', 'equalto', 'docket') | map(attribute='installed') | list | first | bool"
docket_enable: "{{ local_services | selectattr('name', 'equalto', 'docket') | map(attribute='enabled') | first | bool }}"
when: "'docket' in installed_services"
docket_enable: "{{ 'docket' in enabled_servicesl }}"

- hosts: kibana
tags:
Expand All @@ -167,4 +167,4 @@
become: true
roles:
- role: kibana
when: "rock_services | selectattr('name', 'equalto', 'kibana') | map(attribute='installed') | list | first | bool"
when: "'kibana' in installed_services"
15 changes: 11 additions & 4 deletions playbooks/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,50 +39,57 @@ rock_services:
quota_weight: 1
installed: true
enabled: true
version: 3.1.5
- name: stenographer
quota_weight: 8
installed: true
enabled: true
version: 1:0-2
- name: docket
quota_weight: 0
installed: true
enabled: true
version: 1.0.3
- name: suricata
quota_weight: 2
installed: true
enabled: true
version: 5.0.5
- name: elasticsearch
quota_weight: 4
installed: true
enabled: true
version: 7.11.2
- name: kibana
quota_weight: 0
installed: true
enabled: true
version: 7.11.2
- name: zookeeper
quota_weight: 0
installed: true
enabled: true
version: 3.4.14
- name: kafka
quota_weight: 4
installed: true
enabled: true
version: 2.3.0
- name: lighttpd
quota_weight: 0
installed: true
enabled: true
- name: fsf
quota_weight: 1
installed: true
enabled: true
version: 1.4.54
- name: filebeat
quota_weight: 0
installed: true
enabled: true
version: 7.11.2
- name: logstash
quota_weight: 0
installed: true
enabled: true
version: 7.11.2

rocknsm_package_list:
- jq
Expand Down
2 changes: 1 addition & 1 deletion playbooks/manage-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- name: collect enabled services
set_fact:
enabled_services: "{{ rock_services | selectattr('enabled', 'equalto', True) | map(attribute='name') | list }}"
enabled_services: "{{ rock_services | rejectattr('enabled', 'equalto', False) | map(attribute='name') | list }}"

- name: Collect ROCK services from facts
set_fact:
Expand Down
2 changes: 1 addition & 1 deletion roles/common/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
# The "base" repo only goes up to 0.13, so we need to exclude it for this task
- name: Install pyopenssl package
yum:
name: python2-pyOpenSSL
name: pyOpenSSL
state: installed
when: "'docket' in group_names or 'stenographer' in group_names or 'kibana' in group_names"

Expand Down
Loading

0 comments on commit 58650c3

Please sign in to comment.