-
Notifications
You must be signed in to change notification settings - Fork 33
Develop ancillaryrh7 #368
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
base: develop
Are you sure you want to change the base?
Develop ancillaryrh7 #368
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -352,6 +352,26 @@ Vagrant.configure(2) do |config| | |
server.vm.network :private_network, ip: "10.0.1.18" | ||
end | ||
|
||
# Research ancillary server1 on RedHat 7.5 and above | ||
config.vm.define :research_ancillary1_services do |server| | ||
# server.vm.box = "bento/centos-6.10" | ||
server.vm.box = "clouddood/RH7.5_baserepo" | ||
server.vm.host_name = "research-ancillary01.test.dev" | ||
|
||
server.ssh.forward_agent = true | ||
|
||
server.vm.provision "ansible" do |ansible| | ||
ansible.playbook = "deploy_ancillaryRH7.dev_local" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 We should not have separate playbooks for local and production, the same playbooks should be used and controlled by variables that can be overwritten. |
||
ansible.inventory_path = "vagrant_hosts" | ||
ansible.tags = ansible_tags | ||
ansible.verbose = ansible_verbosity | ||
ansible.extra_vars = ansible_extra_vars | ||
ansible.limit = ansible_limit | ||
end | ||
|
||
server.vm.network :private_network, ip: "10.0.1.50" | ||
end | ||
|
||
# Research EOD server | ||
config.vm.define :research_eod do |server| | ||
server.vm.box = "bento/centos-6.10" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
- hosts: research_ancillary1_services | ||
vars: | ||
custom_repo: true | ||
vars_files: | ||
- ~/RHACCOUNT | ||
become: yes | ||
become_method: sudo | ||
pre_tasks: | ||
- debug: | ||
msg: "Variables: _uid = {{ _uid }}, _pwd = **********" | ||
# msg: "Variables: _uid = {{ _uid }}, _pwd = {{ _pwd }}" | ||
- name: register RHEL7.5 | ||
command: "/usr/bin/subscription-manager register --username {{ _uid }} --password {{ _pwd }} --auto-attach" | ||
when: _uid != "" and _pwd != "" | ||
# command: "/usr/bin/subscription-manager register --username <name> --password <password> --auto-attach" | ||
- name: register RHEL7 repo | ||
command: "/usr/bin/subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-optional-rpms" | ||
- name: register RHEL7 RHSCL Repo | ||
shell: "/usr/bin/subscription-manager repos --enable=rhel-server-rhscl-7-rpms" | ||
- name: register RHEL7 DevTools | ||
shell: "/usr/bin/subscription-manager repos --enable=rhel-7-server-devtools-rpms" | ||
- name: list RHEL enabled repos | ||
shell: "/usr/bin/subscription-manager repos --list-enabled" | ||
register: enabled_repos | ||
- debug: | ||
msg: "RHEL Enabled Repos: {{ enabled_repos }}" | ||
# tasks: | ||
- name: download epel | ||
shell: wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -O /tmp/epel-release-latest-7.noarch.rpm | ||
- name: Install epel | ||
shell: yum -y localinstall /tmp/epel*rpm | ||
|
||
- name: install X Window System | ||
shell: yum -y groupinstall "X Window System" | ||
|
||
- name: install XFCE | ||
shell: yum -y groupinstall "xfce" | ||
|
||
- name: install Evince | ||
shell: yum -y install evince | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a whole role for this, that seems to require installing many more dependencies. I'm going to remove this and call the evince role. |
||
|
||
- name: Install python-pip | ||
shell: yum install -y python27 python-pip | ||
- name: install gdown | ||
shell: pip install gdown | ||
# yum: | ||
# name: python27-python-pip | ||
# state: latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 we should call the python27 role here. |
||
- name: Install python 3.6 and pip | ||
shell: yum install -y python36 python36-pip | ||
|
||
# - name: enable scl | ||
# become: yes | ||
# become_method: sudo | ||
# shell: scl enable python27 bash | ||
# - name: install gdown | ||
# shell: /opt/rh/python27/root/usr/bin/pip install gdown | ||
|
||
# Already secure copy to destination host | ||
- name: use gdown to download and build local repo | ||
shell: gdown https://drive.google.com/uc?id=1qaZH9_SrGyjHjWT3P2WtvZAhEkP9YG1Z -O /tmp/ancilRH7_repo.tar.gz | ||
# when: stage == "DEV_LOCAL" | ||
# stage values = { "DEV_LOCAL","DEV", "PROD" } | ||
|
||
# shell: gdown https://drive.google.com/uc?id=139Z0MfyT0WVWIzP_uwM2KxPCrfYs_vUV | ||
# - name: Install pip | ||
# easy_install: | ||
# name: pip | ||
# state: latest | ||
# - name: Build custom local repo | ||
# shell: wget https://drive.google.com/open?id=1qaZH9_SrGyjHjWT3P2WtvZAhEkP9YG1Z /tmp | ||
- name: make localrepo directory | ||
shell: mkdir -p /opt/ancillary_local | ||
- name: make OpenOffice directory | ||
shell: mkdir -p /opt/ancillary_local/OO416 | ||
- name: make Sublime3 directory | ||
shell: mkdir -p /opt/ancillary_local/Sublime3 | ||
- name: make Sublime3 install directory | ||
shell: mkdir -p /usr/local/sublime | ||
- name: make stattransfer14 install directory | ||
shell: mkdir -p /usr/local/StatTransfer14 | ||
|
||
|
||
- name: Extract repo to destination point | ||
shell: tar xvf /tmp/ancilRH7_repo.tar.gz -C /opt/ancillary_local | ||
- name: Extract OpenOffice 4.1.6 | ||
shell: tar xvf /opt/ancillary_local/Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_en-US.tar.gz -C /opt/ancillary_local/OO416 | ||
- name: install bz2 | ||
yum: | ||
name: bzip2 | ||
|
||
- name: Extract Sublime3 | ||
shell: tar xvf /opt/ancillary_local/sublime_text_3_build_3207_x64.tar.bz2 -C /opt/ancillary_local/Sublime3 | ||
|
||
- name: Extract Sublime3 to install dir | ||
shell: tar xvf /opt/ancillary_local/sublime_text_3_build_3207_x64.tar.bz2 -C /usr/local/sublime | ||
|
||
- name: install createrepo | ||
yum: | ||
name: createrepo | ||
state: latest | ||
- name: create local repo | ||
shell: createrepo /opt/ancillary_local/OO416 | ||
# shell: createrepo /opt/devrepo-master/Packages | ||
- name: create local repo file with updated link | ||
file: | ||
path: /etc/yum.repos.d/local.repo | ||
state: touch | ||
mode: "u=rw,g=r,o=r" | ||
- name: edit local.repo file | ||
shell: | | ||
echo '[localrepo] | ||
name=localrepo | ||
baseurl=file:///opt/ancillary_local/OO416 | ||
enabled=1 | ||
gpgcheck=0' >> /etc/yum.repos.d/local.repo | ||
roles: | ||
- umask | ||
# - devtools | ||
- devtools7 | ||
# - open_office | ||
- open_officeRH7 | ||
# - evince | ||
# See line #39 (evince) | ||
# - stattransfer | ||
- stattransfer14 | ||
# - sublime | ||
- sublime3 | ||
# - ultra-edit | ||
- ultra-editRH7 | ||
- texliveRH7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 Why are we calling these roles for the local install, but not the prod deployment? Looks like in prod we're deploying each role as a task in the playbook. I think we prefer to break them into roles. Also, why are there two separate playbooks for local and prod - typically we've used the when: custom_repo tag to be a determination between prod and local development. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just a marker to work out the diffs and conditionals before a single playbook covering multiple scenarios are integrated |
||
|
||
post_tasks: | ||
# - name: Install texlive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 probably want to remove commented out code throughout. |
||
# yum: | ||
# name: texlive2016 | ||
# state: present | ||
|
||
# - name: remove RHEL7.5 | ||
# command: "/usr/bin/subscription-manager remove --all" | ||
# - name: unregister RHEL7.5 | ||
# command: "/usr/bin/subscription-manager unregister" | ||
# - name: clean RHEL7.5 | ||
# command: "/usr/bin/subscription-manager clean" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
- hosts: wdcreancil02 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 I think we want to merge this into the deploy_researcher_environment.yml file, and either add these tasks as roles in the research_ancillary_services hosts section, or make a new section for research_ancillary_services_rh7. |
||
vars: | ||
custom_repo: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 We do not want to hard-code |
||
vars_files: | ||
- ~/RHACCOUNT | ||
become: yes | ||
become_method: sudo | ||
pre_tasks: | ||
- debug: | ||
msg: "Variables: _uid = {{ _uid }}, _pwd = **********" | ||
# msg: "Variables: _uid = {{ _uid }}, _pwd = {{ _pwd }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 Remove debug code |
||
- name: register RHEL7.5 | ||
command: "/usr/bin/subscription-manager register --username {{ _uid }} --password {{ _pwd }} --auto-attach" | ||
when: _uid != "" and _pwd != "" | ||
# command: "/usr/bin/subscription-manager register --username <name> --password <password> --auto-attach" | ||
- name: register RHEL7 repo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 is this necessary in prod, or should we be using the satellite managed by SE? |
||
command: "/usr/bin/subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-optional-rpms" | ||
- name: register RHEL7 RHSCL Repo | ||
shell: "/usr/bin/subscription-manager repos --enable=rhel-server-rhscl-7-rpms" | ||
- name: register RHEL7 DevTools | ||
shell: "/usr/bin/subscription-manager repos --enable=rhel-7-server-devtools-rpms" | ||
- name: list RHEL enabled repos | ||
shell: "/usr/bin/subscription-manager repos --list-enabled" | ||
register: enabled_repos | ||
- debug: | ||
msg: "RHEL Enabled Repos: {{ enabled_repos }}" | ||
# tasks: | ||
- name: download epel | ||
shell: wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -O /tmp/epel-release-latest-7.noarch.rpm | ||
- name: Install epel | ||
shell: yum -y localinstall /tmp/epel*rpm | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these dependencies or part of the Ancillary services? Might be a good idea to group all dependencies that can be yum installed, and adding them in one task and using with_items: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have added an epel7 role, so will replace this with that role |
||
- name: install X Window System | ||
shell: yum -y groupinstall "X Window System" | ||
|
||
- name: install XFCE | ||
shell: yum -y groupinstall "xfce" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 I don't think we need to install |
||
|
||
- name: install Evince | ||
shell: yum -y install evince | ||
|
||
- name: Install python-pip | ||
shell: yum install -y python27 python-pip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 There's already a role for python, we should use that instead. |
||
- name: install gdown | ||
shell: pip install gdown | ||
# yum: | ||
# name: python27-python-pip | ||
# state: latest | ||
- name: Install python 3.6 and pip | ||
shell: yum install -y python36 python36-pip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we be calling the python3 role for this, not installing python separately? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a specific directive for RHEL7, it could be placed in a role, but we probably would have to make more fine-grained than python3, probably will have to spell out python3.6, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 Same here, there's a role for python3 that should be used. |
||
|
||
# - name: enable scl | ||
# become: yes | ||
# become_method: sudo | ||
# shell: scl enable python27 bash | ||
# - name: install gdown | ||
# shell: /opt/rh/python27/root/usr/bin/pip install gdown | ||
|
||
# Already secure copy to destination host | ||
# - name: use gdown to download and build local repo | ||
# shell: gdown https://drive.google.com/uc?id=1qaZH9_SrGyjHjWT3P2WtvZAhEkP9YG1Z -O /tmp/ancilRH7_repo.tar.gz | ||
|
||
# shell: gdown https://drive.google.com/uc?id=139Z0MfyT0WVWIzP_uwM2KxPCrfYs_vUV | ||
# - name: Install pip | ||
# easy_install: | ||
# name: pip | ||
# state: latest | ||
# - name: Build custom local repo | ||
# shell: wget https://drive.google.com/open?id=1qaZH9_SrGyjHjWT3P2WtvZAhEkP9YG1Z /tmp | ||
- name: make localrepo directory | ||
shell: mkdir -p /opt/ancillary_local | ||
- name: make OpenOffice directory | ||
shell: mkdir -p /opt/ancillary_local/OO416 | ||
- name: make Sublime3 directory | ||
shell: mkdir -p /opt/ancillary_local/Sublime3 | ||
- name: make Sublime3 install directory | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 What are these folders for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. folders are for custom local repo to stage installation files like /artifacts, will update to use /artifacts instead |
||
shell: mkdir -p /usr/local/sublime | ||
- name: make stattransfer14 install directory | ||
shell: mkdir -p /usr/local/StatTransfer14 | ||
|
||
|
||
- name: Extract repo to destination point | ||
shell: tar xvf /tmp/ancilRH7_repo.tar.gz -C /opt/ancillary_local | ||
- name: Extract OpenOffice 4.1.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we use the existing open_office role for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel @stirlingv Yep, use existing roles when possible. |
||
shell: tar xvf /opt/ancillary_local/Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_en-US.tar.gz -C /opt/ancillary_local/OO416 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 I think these tar files should be in the /artifacts folder on the jenkins machine |
||
- name: install bz2 | ||
yum: | ||
name: bzip2 | ||
|
||
- name: Extract Sublime3 | ||
shell: tar xvf /opt/ancillary_local/sublime_text_3_build_3207_x64.tar.bz2 -C /opt/ancillary_local/Sublime3 | ||
|
||
- name: Extract Sublime3 to install dir | ||
shell: tar xvf /opt/ancillary_local/sublime_text_3_build_3207_x64.tar.bz2 -C /usr/local/sublime | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 should there be 2 extract tasks for sublime?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, shouldn't we be using the existing sublime role? or a new sublime_rhe7 one if the install is different/requires other dependencies for rh7? |
||
|
||
- name: install createrepo | ||
yum: | ||
name: createrepo | ||
state: latest | ||
- name: create local repo | ||
shell: createrepo /opt/ancillary_local/OO416 | ||
# shell: createrepo /opt/devrepo-master/Packages | ||
- name: create local repo file with updated link | ||
file: | ||
path: /etc/yum.repos.d/local.repo | ||
state: touch | ||
mode: "u=rw,g=r,o=r" | ||
- name: edit local.repo file | ||
shell: | | ||
echo '[localrepo] | ||
name=localrepo | ||
baseurl=file:///opt/ancillary_local/OO416 | ||
enabled=1 | ||
gpgcheck=0' >> /etc/yum.repos.d/local.repo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lel99999 What is the local repo for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the local repo duplicates the /artifacts functionality ... will upload there and mark as resolved. |
||
roles: | ||
- umask | ||
# - devtools | ||
- devtools7 | ||
# - open_office | ||
- open_officeRH7 | ||
# - evince | ||
# See line #39 (evince) | ||
# - stattransfer | ||
- stattransfer14 | ||
# - sublime | ||
- sublime3 | ||
# - ultra-edit | ||
- ultra-editRH7 | ||
- texliveRH7 | ||
|
||
post_tasks: | ||
# - name: Install texlive | ||
# yum: | ||
# name: texlive2016 | ||
# state: present | ||
|
||
# - name: remove RHEL7.5 | ||
# command: "/usr/bin/subscription-manager remove --all" | ||
# - name: unregister RHEL7.5 | ||
# command: "/usr/bin/subscription-manager unregister" | ||
# - name: clean RHEL7.5 | ||
# command: "/usr/bin/subscription-manager clean" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
# RHEL 7 | ||
#- name: Add RHSCL Repo | ||
# become: yes | ||
# become_method: sudo | ||
# command: yum-config-manager --enable rhel-server-rhscl-7-rpms | ||
# tags: | ||
# - devtools7 | ||
|
||
- name: Install Devtools 7 | ||
become: yes | ||
become_method: sudo | ||
yum: | ||
name: devtoolset-7 | ||
state: present | ||
tags: | ||
- devtools7 | ||
|
||
- name: Start using devtools | ||
become: yes | ||
become_method: sudo | ||
command: scl enable devtoolset-7 bash | ||
rags: | ||
- devtools7 | ||
|
||
# CentOS | ||
#- name: Install devtools repo | ||
# template: | ||
# src: devtools-2.repo.j2 | ||
# dest: /etc/yum.repos.d/devtools-2.repo | ||
# mode: 0644 | ||
# when: not os=rhel7 | ||
# when: not custom_repo | ||
# tags: | ||
# - devtools | ||
|
||
#- name: Install updated devtools | ||
# yum: | ||
# name: "{{ item }}" | ||
# state: present | ||
# with_items: | ||
# - devtoolset-2-binutils | ||
# - devtoolset-2-build | ||
# - devtoolset-2-gcc | ||
# - devtoolset-2-gcc-c++ | ||
# - devtoolset-2-gcc-gfortran | ||
# - devtoolset-2-gdb | ||
# - devtoolset-2-git | ||
# when: not os=rhel7 | ||
# tags: | ||
# - devtools | ||
|
||
# Breaks some system tools | ||
#- name: Setup environment variables to use new versions | ||
# template: | ||
# src: devtools-2.sh.j2 | ||
# dest: /etc/profile.d/devtools-2.sh | ||
# mode: 0644 | ||
# tags: | ||
# - devtools |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[devtools-2-centos-$releasever] | ||
name=testing 2 devtools for CentOS $releasever | ||
baseurl=http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS | ||
enabled=0 | ||
gpgcheck=0 | ||
|
||
[devtools-7] | ||
name= | ||
baseurl= | ||
enabled=0 | ||
gpgcheck=0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source /opt/rh/devtoolset-2/enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lel99999 Could you remove commented out lines? Also, to stick with previous conventions please call this config
research_ancillary_services_7