diff --git a/README.md b/README.md new file mode 100644 index 0000000..be673b6 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +. +├── inventory +│   └── hosts.ini +├── playbook.yml +├── roles +│   ├── install-splunk +│   │   ├── files +│   │   │   └── splunk-8.3.1-aa7ca5cfbb32-Linux-x86_64.tgz +│   │   ├── handlers +│   │   │   └── main.yml +│   │   ├── tasks +│   │   │   ├── main.yml +│   │   │   ├── set-splunk-user.yml +│   │   │   └── unpack-splunk.yml +│   │   ├── templates +│   │   ├── tests +│   │   ├── vars +│   │   │   └── main.yml +│   │   └── README.md +│   └── configure-splunk +│   ├── defaults +│   ├── files +│   │   └── splunk-launch.conf +│   ├── handlers +│   │   └── main.yml +│   ├── meta +│   ├── tasks +│   │   ├── main.yml +│   │   ├── set-admin-password.yml +│   │   ├── set-ssl.yml +│   │   └── start-splunk.yml +│   ├── templates +│   ├── tests +│   └── vars +│   └── main.yml +├── README.md +└── vars + └── main.yml \ No newline at end of file diff --git a/inventory/hosts.ini b/inventory/hosts.ini new file mode 100644 index 0000000..438f025 --- /dev/null +++ b/inventory/hosts.ini @@ -0,0 +1,2 @@ +[splunk] +localhost ansible_connection=local \ No newline at end of file diff --git a/roles/install-splunk/task/main.yml b/roles/install-splunk/task/main.yml new file mode 100644 index 0000000..aa73b62 --- /dev/null +++ b/roles/install-splunk/task/main.yml @@ -0,0 +1,10 @@ +--- +- name: Install Splunk + hosts: splunk + vars_files: + - ../vars/main.yml + - vars/main.yml + - roles/install-splunk/vars/main.yml + roles: + - install-splunk + - configure-splunk \ No newline at end of file diff --git a/roles/install-splunk/task/set-splunk-user.yml b/roles/install-splunk/task/set-splunk-user.yml new file mode 100644 index 0000000..9c45dd4 --- /dev/null +++ b/roles/install-splunk/task/set-splunk-user.yml @@ -0,0 +1,9 @@ +--- +- name: Set Splunk user + become: true + user: + name: "{{ splunk_user }}" + home: "{{ splunk_home }}" + shell: /bin/bash + createhome: yes + system: yes \ No newline at end of file diff --git a/roles/install-splunk/task/unpack-splunk.yml b/roles/install-splunk/task/unpack-splunk.yml new file mode 100644 index 0000000..3414385 --- /dev/null +++ b/roles/install-splunk/task/unpack-splunk.yml @@ -0,0 +1,6 @@ +--- +- name: Unpack Splunk + become: true + unarchive: + src: "{{ role_path }}/files/splunk-{{ splunk_version }}-aa7ca + \ No newline at end of file diff --git a/roles/install-splunk/vars/main.yml b/roles/install-splunk/vars/main.yml new file mode 100644 index 0000000..2d7fb35 --- /dev/null +++ b/roles/install-splunk/vars/main.yml @@ -0,0 +1,3 @@ +splunk_version: "8.3.1" +splunk_download_url: "https://download.splunk.com/products/splunk/releases/{{ splunk_version }}/linux/splunk-{{ splunk_version }}-aa7ca5cfbb32-Linux-x86_64.tgz" +splunk_user: "splunk" \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..6e2636a --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,4 @@ +splunk_username: "admin" +splunk_password: "password" +splunk_home: "/opt/splunk" +splunk_https: "true" \ No newline at end of file