diff --git a/linux/Tableau_ansible_script/tableau/README.md b/linux/Tableau_ansible_script/tableau/README.md new file mode 100644 index 0000000..2fa1c62 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/README.md @@ -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 diff --git a/linux/Tableau_ansible_script/tableau/defaults/main.yml b/linux/Tableau_ansible_script/tableau/defaults/main.yml new file mode 100644 index 0000000..40a97f6 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for /etc/ansible/roles/tableau \ No newline at end of file diff --git a/linux/Tableau_ansible_script/tableau/files/config.json b/linux/Tableau_ansible_script/tableau/files/config.json new file mode 100644 index 0000000..c45e032 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/files/config.json @@ -0,0 +1,16 @@ +{ + "configEntities": { + "identityStore": { + "_type": "identityStoreType", + "type": "local" + }, + "gatewaySettings": { + "_type": "gatewaySettingsType", + "port": 8000, + "firewallOpeningEnabled": true, + "sslRedirectEnabled": true, + "publicHost": "localhost", + "publicPort": 8000 + } + } +} diff --git a/linux/Tableau_ansible_script/tableau/files/reg_templ.json b/linux/Tableau_ansible_script/tableau/files/reg_templ.json new file mode 100644 index 0000000..87aee8f --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/files/reg_templ.json @@ -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]" +} diff --git a/linux/Tableau_ansible_script/tableau/handlers/main.yml b/linux/Tableau_ansible_script/tableau/handlers/main.yml new file mode 100644 index 0000000..ad84c22 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for /etc/ansible/roles/tableau \ No newline at end of file diff --git a/linux/Tableau_ansible_script/tableau/meta/main.yml b/linux/Tableau_ansible_script/tableau/meta/main.yml new file mode 100644 index 0000000..7223799 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/meta/main.yml @@ -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. \ No newline at end of file diff --git a/linux/Tableau_ansible_script/tableau/tasks/configure.yml b/linux/Tableau_ansible_script/tableau/tasks/configure.yml new file mode 100644 index 0000000..66702b4 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/tasks/configure.yml @@ -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 diff --git a/linux/Tableau_ansible_script/tableau/tasks/initialize.yml b/linux/Tableau_ansible_script/tableau/tasks/initialize.yml new file mode 100644 index 0000000..58b9b43 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/tasks/initialize.yml @@ -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 diff --git a/linux/Tableau_ansible_script/tableau/tasks/install.yml b/linux/Tableau_ansible_script/tableau/tasks/install.yml new file mode 100644 index 0000000..11ac81d --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/tasks/install.yml @@ -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 diff --git a/linux/Tableau_ansible_script/tableau/tasks/main.yml b/linux/Tableau_ansible_script/tableau/tasks/main.yml new file mode 100644 index 0000000..37cc428 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/tasks/main.yml @@ -0,0 +1,6 @@ +--- +# tasks file for /etc/ansible/roles/tableau + +- import_tasks: configure.yml +- import_tasks: install.yml +- import_tasks: initialize.yml diff --git a/linux/Tableau_ansible_script/tableau/tests/inventory b/linux/Tableau_ansible_script/tableau/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/linux/Tableau_ansible_script/tableau/tests/test.yml b/linux/Tableau_ansible_script/tableau/tests/test.yml new file mode 100644 index 0000000..1de68f0 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - /etc/ansible/roles/tableau \ No newline at end of file diff --git a/linux/Tableau_ansible_script/tableau/vars/main.yml b/linux/Tableau_ansible_script/tableau/vars/main.yml new file mode 100644 index 0000000..a6472e4 --- /dev/null +++ b/linux/Tableau_ansible_script/tableau/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for /etc/ansible/roles/tableau \ No newline at end of file