-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benoit Moussaud
committed
Jun 10, 2020
1 parent
8ce0a8d
commit 986d89f
Showing
19 changed files
with
529 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apt update | ||
apt install --yes software-properties-common | ||
apt-add-repository --yes --update ppa:ansible/ansible | ||
apt install --yes ansible | ||
ansible-playbook --version | ||
echo "-- DONE --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
apiVersion: xl-deploy/v1 | ||
kind: Applications | ||
spec: | ||
- name: Applications/ansible-controller | ||
type: udm.Application | ||
lastVersion: 1.0.1 | ||
children: | ||
- name: 1.0.0 | ||
type: udm.ProvisioningPackage | ||
deployables: | ||
- name: ansible-instance | ||
type: aws.ec2.InstanceSpec | ||
boundTemplates: | ||
- Applications/ansible-controller/1.0.0/ansible-host-template | ||
provisioners: | ||
- name: ansible-setup | ||
type: script.provisioner.Script | ||
hostTemplate: Applications/ansible-controller/1.0.0/ansible-host-template | ||
file: !file "artifacts/Applications/ansible-controller/1.0.0/ansible-instance/ansible-setup/provision_ansible.sh" | ||
instanceName: ansible-controller-instance | ||
amiId: ami-08c757228751c5335 | ||
region: eu-west-3 | ||
securityGroup: | ||
- Name:ansible-controller-sg | ||
instanceType: t2.micro | ||
keyName: adlere-seminaire | ||
- name: ansible-controller-sg | ||
type: aws.vpc.SecurityGroupSpec | ||
securityGroupName: ansible-controller-sg | ||
description: ssh-security (HTTP/SSH) | ||
region: eu-west-3 | ||
inboundRules: | ||
- name: ssh | ||
type: aws.vpc.SecurityGroupInboundRuleSpec | ||
protocol: TCP | ||
portRange: "22" | ||
source: 0.0.0.0/0 | ||
templates: | ||
- name: ansible-host-template | ||
type: template.overthere.SshHost | ||
instanceName: ansible-controller-{{%instanceId%}}-host | ||
childTemplates: | ||
- name: ansible-controler-template | ||
type: template.ansible.Controller | ||
instanceName: defaultAnsibleController | ||
ansiblePlaybookPath: /usr/bin/ansible-playbook | ||
ansibleGalaxyPath: /usr/bin/ansible-galaxy | ||
tags: | ||
- ansible_roles_not_applied | ||
os: UNIX | ||
connectionType: SUDO | ||
address: '{{%publicHostname%}}' | ||
username: ubuntu | ||
privateKeyFile: /Users/bmoussaud/.ssh/adlere-seminaire.pem | ||
sudoUsername: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
apiVersion: xl-deploy/v1 | ||
kind: Applications | ||
spec: | ||
- name: Applications/java-server-application | ||
type: udm.Application | ||
lastVersion: 0.1.1 | ||
children: | ||
- name: 0.1.1 | ||
type: udm.DeploymentPackage | ||
orchestrator: | ||
- parallel-by-container | ||
deployables: | ||
- name: tomcat | ||
type: ansible.RolesSpec | ||
includeDevOpsAsCodeTask: True | ||
scanPlaceholders: False | ||
file: !file "artifacts/tomcat/0.1.1/roles_tomcat" | ||
tags: | ||
- app_server | ||
roles: | ||
- tomcat | ||
variables: | ||
tomcat_ver: '9.0.30' | ||
ui_manager_user: 'manager' | ||
ui_manager_pass: 'Str0ngManagerP@ssw4rd' | ||
ui_admin_username: 'admin' | ||
ui_admin_pass: 'Str0#ngManagerP@@@ssword' |
6 changes: 6 additions & 0 deletions
6
...Applications/ansible-controller/1.0.0/ansible-instance/ansible-setup/provision_ansible.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apt update | ||
apt install --yes software-properties-common | ||
apt-add-repository --yes --update ppa:ansible/ansible | ||
apt install --yes ansible | ||
ansible-playbook --version | ||
echo "-- DONE --" |
3 changes: 3 additions & 0 deletions
3
xebialabs/artifacts/tomcat/0.1.1/roles_tomcat/roles/tomcat/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
tomcat_archive_url: https://archive.apache.org/dist/tomcat/tomcat-9/v{{ tomcat_ver }}/bin/apache-tomcat-{{ tomcat_ver }}.tar.gz | ||
tomcat_archive_dest: /tmp/apache-tomcat-{{ tomcat_ver }}.tar.gz |
4 changes: 4 additions & 0 deletions
4
xebialabs/artifacts/tomcat/0.1.1/roles_tomcat/roles/tomcat/handlers/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: restart tomcat | ||
service: | ||
name: tomcat | ||
state: restarted |
8 changes: 8 additions & 0 deletions
8
xebialabs/artifacts/tomcat/0.1.1/roles_tomcat/roles/tomcat/tasks/main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Add the OS specific variables | ||
include_vars: "{{ item }}" | ||
with_first_found: | ||
- "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" | ||
- "{{ ansible_os_family }}.yml" | ||
|
||
- include_tasks: "tomcat-setup-{{ ansible_os_family }}.yml" |
94 changes: 94 additions & 0 deletions
94
xebialabs/artifacts/tomcat/0.1.1/roles_tomcat/roles/tomcat/tasks/tomcat-setup-Debian.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
- name: Ensure the system can use the HTTPS transport for APT. | ||
stat: | ||
path: /usr/lib/apt/methods/https | ||
register: apt_https_transport | ||
|
||
- name: Install APT HTTPS transport. | ||
apt: | ||
name: "apt-transport-https" | ||
state: present | ||
update_cache: yes | ||
when: not apt_https_transport.stat.exists | ||
|
||
- name: Install basic packages | ||
package: | ||
name: ['vim','aptitude','bash-completion','tmux','tree','htop','wget','unzip','curl','git'] | ||
state: present | ||
update_cache: yes | ||
|
||
- name: Install Default Java (Debian/Ubuntu) | ||
apt: | ||
name: default-jdk | ||
state: present | ||
|
||
- name: Add tomcat group | ||
group: | ||
name: tomcat | ||
|
||
- name: Add "tomcat" user | ||
user: | ||
name: tomcat | ||
group: tomcat | ||
home: /usr/share/tomcat | ||
createhome: no | ||
system: yes | ||
|
||
- name: Download Tomcat | ||
get_url: | ||
url: "{{ tomcat_archive_url }}" | ||
dest: "{{ tomcat_archive_dest }}" | ||
|
||
- name: Create a tomcat directory | ||
file: | ||
path: /usr/share/tomcat | ||
state: directory | ||
owner: tomcat | ||
group: tomcat | ||
|
||
- name: Extract tomcat archive | ||
unarchive: | ||
src: "{{ tomcat_archive_dest }}" | ||
dest: /usr/share/tomcat | ||
owner: tomcat | ||
group: tomcat | ||
remote_src: yes | ||
extra_opts: "--strip-components=1" | ||
creates: /usr/share/tomcat/bin | ||
|
||
- name: Copy tomcat service file | ||
template: | ||
src: templates/tomcat.service.j2 | ||
dest: /etc/systemd/system/tomcat.service | ||
when: ansible_service_mgr == "systemd" | ||
|
||
- name: Start and enable tomcat | ||
service: | ||
daemon_reload: yes | ||
name: tomcat | ||
state: started | ||
enabled: yes | ||
when: ansible_service_mgr == "systemd" | ||
- name: Set UI access credentials | ||
template: | ||
src: tomcat-users.xml.j2 | ||
dest: /usr/share/tomcat/conf/tomcat-users.xml | ||
notify: restart tomcat | ||
|
||
- name: Allow access to Manager and Host Manager apps from any IP | ||
template: | ||
src: context.xml.j2 | ||
dest: "{{ item }}" | ||
with_items: | ||
- /usr/share/tomcat/webapps/host-manager/META-INF/context.xml | ||
- /usr/share/tomcat/webapps/manager/META-INF/context.xml | ||
notify: restart tomcat | ||
|
||
- name: Generate the Devops-As-Code | ||
template: src=xldeploy.yaml.j2 dest=/tmp/digital.ai_xldeploy.yaml mode=0755 | ||
|
||
- name: Fetch the Devops-As-Code yaml file on the master | ||
fetch: | ||
src: /tmp/digital.ai_xldeploy.yaml | ||
dest: "{{ devops_as_code_directory }}" | ||
flat: no | ||
|
Oops, something went wrong.