Skip to content

Add the code for the "Manager" option; have both old and new option r… #135

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Note: Any task with an **adhoc** prefix means that it can be used independently
- **configure_idxc_manager.yml** - Configures a Splunk host to act as a manager node using `splunk_idxc_rf`, `splunk_idxc_sf`, `splunk_idxc_key`, and `splunk_idxc_label`.
- **configure_idxc_member.yml** - Configures a Splunk host as an indexer cluster member using `splunk_uri_cm`, `splunk_idxc_rep_port`, and `splunk_idxc_key`.
- **configure_idxc_sh.yml** - Configures a search head to join an existing indexer cluster using `splunk_uri_cm` and `splunk_idxc_key`.
- **configure_license.yml** - Configure the license group to the `splunk_license_group` variable defined. Default is `Trial`. Available values are "Trial, Free, Enterprise, Forwarder, Manager or Peer. If set to `Peer`, the `splunk_uri_lm` must be defined. Note: This could also be accomplished using configure_apps.yml with a git repository.
- **configure_license.yml** - Configure the license group to the `splunk_license_group` variable defined. Default is `Trial`. Available values are "Trial, Free, Enterprise, Forwarder or Peer. If set to `Peer`, the `splunk_uri_lm` and `splunk_lm_key` must be defined. To have a Splunk server defined as license manager, the host should be assigned to the licensemanager group and the `splunk_lm_key` must be defined. Note: This could also be accomplished using configure_apps.yml with a git repository.
- **configure_os.yml** - Increases ulimits for the splunk user and disables Transparent Huge Pages (THP) per Splunk implementation best practices.
- **configure_serverclass.yml** - Generates a new serverclass.conf file from the serverclass.conf.j2 template and installs it to $SPLUNK_HOME/etc/system/local/serverclass.conf.
- **configure_shc_captain.yml** - Perform a `bootstrap shcluster-captain` using the server list provided in `splunk_shc_uri_list`.
Expand Down
2 changes: 1 addition & 1 deletion playbooks/splunk_upgrade_full_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
deployment_task: check_splunk.yml

- hosts:
- licensemaster
- licensemanager
- shdeployer
- deploymentserver
become: yes
Expand Down
1 change: 1 addition & 0 deletions roles/splunk/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ clientName: undefined
phoneHomeIntervalInSecs: undefined
splunk_general_key: undefined # Configures a pass4SymmKey in server.conf under the general stanza
splunk_ds_key: undefined # Configures a pass4SymmKey in server.conf for authenticating against a deployment server
splunk_lm_key: undefined # Configures a pass4SymmKey in server.conf for authenticating against a license manager
splunk_admin_username: admin
splunk_admin_password: undefined # Use ansible-vault encrypt_string, e.g. ansible-vault encrypt_string --ask-vault-pass 'var_value_to_encrypt' --name 'var_name'
splunk_configure_secret: false # If set to true, you need to update files/splunk.secret
Expand Down
28 changes: 27 additions & 1 deletion roles/splunk/tasks/configure_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,31 @@
become: yes
when:
- splunk_license_group=="Enterprise"
- name: Set pass4SymmKey on LM
ini_file:
path: "{{ splunk_home }}/etc/system/local/server.conf"
section: general
option: pass4SymmKey
value: "{{ splunk_lm_key }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
become: true
notify: restart splunk
when:
- "'licensemanager' in group_names"
- splunk_lm_key != 'undefined'
- name: Remove master_uri when using local license
ini_file:
path: "{{ splunk_home }}/etc/system/local/server.conf"
section: license
option: "{{ item }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
state: absent
with_items:
- manager_uri
- master_uri
become: true
- name: Remove master_uri when using local license
ini_file:
path: "{{ splunk_home }}/etc/system/local/server.conf"
Expand Down Expand Up @@ -71,11 +96,12 @@
path: "{{ splunk_home }}/etc/system/local/server.conf"
section: general
option: pass4SymmKey
value: "{{ pass4SymmKey }}"
value: "{{ splunk_lm_key }}"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
become: yes
notify: restart splunk
when:
- splunk_license_group=="Peer"
- splunk_install_type=="full"
- splunk_lm_key != 'undefined'