From 76b24b0236008f24a8129808e2e8be90cd5b911d Mon Sep 17 00:00:00 2001 From: abasha1234 Date: Wed, 31 Jan 2024 16:19:51 +0530 Subject: [PATCH] feat: Add deploy config for ruby on rails --- .../redhat/roles/configure/tasks/main.yml | 49 +++++++++++++++++++ .../definitions/apm/ruby/rubyonrails.json | 27 ++++++++++ 2 files changed, 76 insertions(+) create mode 100644 test/deploy/linux/ruby/ruby-on-rails/redhat/roles/configure/tasks/main.yml create mode 100644 test/manual/definitions/apm/ruby/rubyonrails.json diff --git a/test/deploy/linux/ruby/ruby-on-rails/redhat/roles/configure/tasks/main.yml b/test/deploy/linux/ruby/ruby-on-rails/redhat/roles/configure/tasks/main.yml new file mode 100644 index 000000000..2f73d784c --- /dev/null +++ b/test/deploy/linux/ruby/ruby-on-rails/redhat/roles/configure/tasks/main.yml @@ -0,0 +1,49 @@ +--- +- debug: + msg: Install Ruby on Rails + +- name: update yum packages + shell: yum update -y + become: true + +- name: install ruby + shell: yum install ruby -y + become: true + +- name: install rubygems + shell: yum install rubygems -y + become: true + +- name: update gem + shell: gem update --system + become: true + +- name: install bundler + shell: gem install bundler + become: true + +- name: install ruby-devel + shell: yum install ruby-devel -y + become: true + +- name: install dev tools + shell: yum groupinstall "Development Tools" -y + become: true + +- name: install pre-reqs + shell: yum install libffi-devel libyaml-devel readline-devel zlib-devel openssl-devel -y + become: true + +- name: install rails + shell: gem install rails + become: true + +- name: update gem bundler + shell: gem update bundler + become: true + +- name: create sample ruby application + shell: rails new sample_ruby_app2 --skip-bundle + +- name: change directory to sample application + ansible.builtin.shell: cd ~/sample_ruby_app2 && bundle install \ No newline at end of file diff --git a/test/manual/definitions/apm/ruby/rubyonrails.json b/test/manual/definitions/apm/ruby/rubyonrails.json new file mode 100644 index 000000000..35475a132 --- /dev/null +++ b/test/manual/definitions/apm/ruby/rubyonrails.json @@ -0,0 +1,27 @@ +{ + "global_tags": { + "owning_team": "virtuoso", + "Environment": "development", + "Department": "product", + "Product": "virtuoso" + }, + "resources": [ + { + "id": "ruby-on-rails-linux2", + "provider": "aws", + "type": "ec2", + "size": "t2.medium", + "ami_name": "al2023-ami-2023.3.20240122.0-kernel-6.1-x86_64", + "user_name": "ec2-user" + } + ], + "services": [ + { + "id": "rubyrails", + "local_source_path": "/mnt/deployer/", + "deploy_script_path": "test/deploy/linux/ruby/ruby-on-rails/redhat/roles", + "port": 80, + "destinations": ["ruby-on-rails-linux2"] + } + ] + } \ No newline at end of file