Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

ansible script #71

Open
wants to merge 1 commit 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
31 changes: 31 additions & 0 deletions linux/Tableau_ansible_script/tableau/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Role Name
=========

The role installs tableau server and initializes it with a trial period on a RHEL or CentOS Machine
Requirements
------------

The rpm file must be downloaded and placed in the files directory in the role


Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

---
- hosts:
become: yes
roles:
- tableau


License
-------

MIT

Author Information
------------------

Mohan Krishna Ponduri
2 changes: 2 additions & 0 deletions linux/Tableau_ansible_script/tableau/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for /etc/ansible/roles/tableau
16 changes: 16 additions & 0 deletions linux/Tableau_ansible_script/tableau/files/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configEntities": {
"identityStore": {
"_type": "identityStoreType",
"type": "local"
},
"gatewaySettings": {
"_type": "gatewaySettingsType",
"port": 8000,
"firewallOpeningEnabled": true,
"sslRedirectEnabled": true,
"publicHost": "localhost",
"publicPort": 8000
}
}
}
15 changes: 15 additions & 0 deletions linux/Tableau_ansible_script/tableau/files/reg_templ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"zip":"[value]",
"country":"[value]",
"city":"[value]",
"last_name":"[value]",
"industry":"[value]",
"eula":"[value]",
"title":"[value]",
"phone":"[value]",
"company":"[value]",
"state":"[value]",
"department":"[value]",
"first_name":"[value]",
"email":"[value]"
}
2 changes: 2 additions & 0 deletions linux/Tableau_ansible_script/tableau/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for /etc/ansible/roles/tableau
57 changes: 57 additions & 0 deletions linux/Tableau_ansible_script/tableau/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your description
company: your company (optional)

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)

min_ansible_version: 1.2

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:

#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
36 changes: 36 additions & 0 deletions linux/Tableau_ansible_script/tableau/tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- name: Remove line from pam.d/su
pamd:
name: su
type: auth
control: required
module_path: pam_wheel.so
module_arguments: 'use_uid'
state: args_absent

- name: create a new user
user:
name: tableauadmin
state: present
groups: wheel
append: yes
createhome: yes
password: $6$rounds=656000$mysecretsalt$sUzUbR602E1zjO7t0mzqg6EOuzpOfqS9Bqctbr0FRmTWyAm7ZvphrCV/WcPBqvOlU47u212RYRLgjGTztesBn.

- name: Make sure we have a 'wheel' group
group:
name: wheel
state: present

- name: Allow 'wheel' group to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'

#- name: Set up keys for the tableauadmin user
# command: sshpass -p tableauadmin ssh-copy-id tableauadmin@{{ ansible_eth0.ipv4.address }}
# host: 127.0.0.1
# connection: local
46 changes: 46 additions & 0 deletions linux/Tableau_ansible_script/tableau/tasks/initialize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
- name: Copy config file
copy:
src: config.json
dest: /tmp/
mode: '0777'

- name: Copy registration file
copy:
src: reg_templ.json
dest: /tmp/
mode: '0777'

- name: Logging in
command: 'tsm login -u tableauadmin -p tableauadmin'
become_user: tableauadmin
become: no
- name: Activating the tableau license/trial
command: 'tsm licenses activate --trial'
become_user: tableauadmin
become: no

- name: Registering
command: 'tsm register --file /tmp/reg_templ.json'
become_user: tableauadmin
become: no

- name: Importing Setting and Identity store
command: 'tsm settings import -f /tmp/config.json'
become_user: tableauadmin
become: no

- name: Applying pending changed
command: 'tsm pending-changes apply'
become_user: tableauadmin
become: no

- name: Initializing
command: 'tsm initialize --start-server'
become_user: tableauadmin
become: no

- name: Create Initial user
command: 'tabcmd initialuser --username ''admin'' --password ''password'' --server http://localhost:8000'
become_user: tableauadmin
become: no
16 changes: 16 additions & 0 deletions linux/Tableau_ansible_script/tableau/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: copying the tableau rpm file
copy:
src: tableau-server-2019-2-3.x86_64.rpm
dest: /home/tableauadmin/


- name: Installing the tableau server RPM
yum:
name: /home/tableauadmin/tableau-server-2019-2-3.x86_64.rpm
state: present


- name: Initializing the tsm
command: sudo /opt/tableau/tableau_server/packages/scripts.20192.19.0818.2120/initialize-tsm --accepteula
become_user: tableauadmin
6 changes: 6 additions & 0 deletions linux/Tableau_ansible_script/tableau/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# tasks file for /etc/ansible/roles/tableau

- import_tasks: configure.yml
- import_tasks: install.yml
- import_tasks: initialize.yml
2 changes: 2 additions & 0 deletions linux/Tableau_ansible_script/tableau/tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
localhost

5 changes: 5 additions & 0 deletions linux/Tableau_ansible_script/tableau/tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- /etc/ansible/roles/tableau
2 changes: 2 additions & 0 deletions linux/Tableau_ansible_script/tableau/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for /etc/ansible/roles/tableau