mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Remove unused ansible files
all of them replaced by roles
This commit is contained in:
committed by
Dan Christian Bogos
parent
82bf174b35
commit
941ee55fab
@@ -1,19 +0,0 @@
|
||||
# Ansible for CGRateS integration tests
|
||||
|
||||
Steps for running this ansible:
|
||||
1. Configure a debian based virtual machine so you can connect to it without needing the password
|
||||
2. Edit your ansible host file with the IP and the user of the machine like so:
|
||||
```
|
||||
[all]
|
||||
local ansible_host=192.168.56.203 ansible_ssh_user=trial97
|
||||
|
||||
[all:vars]
|
||||
user=trial97
|
||||
```
|
||||
|
||||
3. Run the ansible:
|
||||
```
|
||||
ansible-playbook main.yaml
|
||||
```
|
||||
|
||||
4. Done!
|
||||
@@ -1,37 +0,0 @@
|
||||
---
|
||||
- name: Add an apt key for elastic
|
||||
become: yes
|
||||
apt_key:
|
||||
url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
||||
state: present
|
||||
|
||||
- name: Add apt repository for elastic
|
||||
become: yes
|
||||
apt_repository:
|
||||
repo: "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
|
||||
filename: elastic-7.x
|
||||
update_cache: yes
|
||||
|
||||
- name: Install elastic
|
||||
become: yes
|
||||
apt:
|
||||
name: "elasticsearch"
|
||||
state: present
|
||||
|
||||
- name: Enable elasticsearch service and ensure it is not masked
|
||||
become: yes
|
||||
systemd:
|
||||
name: elasticsearch
|
||||
state: started
|
||||
enabled: yes
|
||||
masked: no
|
||||
|
||||
- name: Install the git
|
||||
become: yes
|
||||
apt:
|
||||
name: curl
|
||||
|
||||
|
||||
- name: create index
|
||||
command: 'curl -X PUT "localhost:9200/cdrs?pretty"'
|
||||
ignore_errors: yes
|
||||
@@ -1,122 +0,0 @@
|
||||
---
|
||||
- name: create gopath directory
|
||||
file:
|
||||
state: directory
|
||||
mode: 'u=rwx,go=rx'
|
||||
dest: '{{ golang_gopath }}'
|
||||
|
||||
- name: create download directory
|
||||
file:
|
||||
state: directory
|
||||
mode: 'u=rwx,go=rx'
|
||||
dest: '{{ golang_download_dir }}'
|
||||
|
||||
- name: Register the current Go version (if any)
|
||||
command: /usr/local/go/bin/go version
|
||||
ignore_errors: yes
|
||||
register: go_version
|
||||
changed_when: false
|
||||
|
||||
- name: Remove old installation of Go
|
||||
become: yes
|
||||
file:
|
||||
path: /usr/local/go
|
||||
state: absent
|
||||
when: go_version is failed or go_version.stdout != go_version_target
|
||||
|
||||
- name: download Go language SDK
|
||||
get_url:
|
||||
url: '{{ golang_mirror }}/{{ golang_redis_filename }}'
|
||||
dest: '{{ golang_download_dir }}/{{ golang_redis_filename }}'
|
||||
mode: 'u=rw,go=r'
|
||||
|
||||
- name: create Go language SDK installation directory
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 'u=rwx,go=rx'
|
||||
dest: '{{ golang_install_dir }}'
|
||||
|
||||
- name: install Go language SDK
|
||||
become: yes
|
||||
unarchive:
|
||||
src: '{{ golang_download_dir }}/{{ golang_redis_filename }}'
|
||||
remote_src: yes
|
||||
extra_opts: '--strip-components=1'
|
||||
dest: '{{ golang_install_dir }}'
|
||||
owner: root
|
||||
group: root
|
||||
creates: '{{ golang_install_dir }}/bin'
|
||||
|
||||
# Set Go language SDK environment variables
|
||||
- name: make sure /etc/profile.d exists
|
||||
become: yes
|
||||
file:
|
||||
path: /etc/profile.d
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 'u=rwx,go=rx'
|
||||
|
||||
- name: export Go language SDK environment variables
|
||||
become: yes
|
||||
template:
|
||||
src: golang.sh.j2
|
||||
dest: /etc/profile.d/golang.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 'u=rw,go=r'
|
||||
|
||||
- name: Export GOROOT for root
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: ~/.bashrc
|
||||
line: export GOROOT='{{ golang_install_dir }}'
|
||||
insertafter: last
|
||||
|
||||
- name: Add GOROOT to PATH for root
|
||||
become: yes
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export PATH=$PATH:$GOROOT/bin
|
||||
insertafter: last
|
||||
|
||||
- name: Export GOPATH for root
|
||||
become: yes
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export GOPATH='{{ golang_gopath }}'
|
||||
insertafter: last
|
||||
|
||||
- name: Add GOPATH to PATH for root
|
||||
become: yes
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export PATH=$PATH:$GOPATH/bin
|
||||
insertafter: last
|
||||
|
||||
- name: Export GOROOT
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export GOROOT='{{ golang_install_dir }}'
|
||||
insertafter: last
|
||||
|
||||
- name: Add GOROOT to PATH
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export PATH=$PATH:$GOROOT/bin
|
||||
insertafter: last
|
||||
|
||||
- name: Export GOPATH
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export GOPATH='{{ golang_gopath }}'
|
||||
insertafter: last
|
||||
|
||||
- name: Add GOPATH to PATH
|
||||
lineinfile:
|
||||
dest: ~/.bashrc
|
||||
line: export PATH=$PATH:$GOPATH/bin
|
||||
insertafter: last
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
{{ ansible_managed | comment('plain') }}
|
||||
|
||||
export GOROOT='{{ golang_install_dir }}'
|
||||
export PATH=$PATH:$GOROOT/bin
|
||||
|
||||
{% if golang_gopath not in (None, '') %}
|
||||
export GOPATH="{{ golang_gopath }}"
|
||||
export PATH=$PATH:$GOPATH/bin
|
||||
{% endif %}
|
||||
@@ -1,13 +0,0 @@
|
||||
[Unit]
|
||||
Requires=zookeeper.service
|
||||
After=zookeeper.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ kafka_user }}
|
||||
ExecStart=/bin/sh -c '/home/{{ kafka_user }}/kafka/bin/kafka-server-start.sh /home/{{ kafka_user }}/kafka/config/server.properties > /home/{{ kafka_user }}/kafka/kafka.log 2>&1'
|
||||
ExecStop=/home/{{ kafka_user }}/kafka/bin/kafka-server-stop.sh
|
||||
Restart=on-abnormal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
- name: Ensure group "kafka" exists
|
||||
become: yes
|
||||
group:
|
||||
name: "{{ kafka_user }}"
|
||||
state: present
|
||||
|
||||
- name: Add the user 'kafka'
|
||||
become: yes
|
||||
user:
|
||||
name: "{{ kafka_user }}"
|
||||
# password: "{{ kafka_user_password }}"
|
||||
groups: "sudo,{{ kafka_user }}"
|
||||
|
||||
- name: Install the java
|
||||
become: yes
|
||||
apt:
|
||||
name: default-jdk
|
||||
|
||||
- name: Ensure download folder
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
mode: 'u=rwx,go=rx'
|
||||
owner: "{{ kafka_user }}"
|
||||
group: "{{ kafka_user }}"
|
||||
path: "{{ kafka_download_folder }}"
|
||||
|
||||
- name: Fetch kafka binary package
|
||||
become: yes
|
||||
get_url:
|
||||
dest: "{{ kafka_download_folder }}/{{ kafka_base_name }}.tgz"
|
||||
url: "{{ kafka_url }}"
|
||||
|
||||
- name: Uncompress the kafka tar
|
||||
become: yes
|
||||
unarchive:
|
||||
copy: no
|
||||
creates: "/home/{{ kafka_user }}/{{ kafka_base_name }}"
|
||||
dest: "{{ kafka_install_folder }}"
|
||||
src: "{{ kafka_download_folder }}/{{ kafka_base_name }}.tgz"
|
||||
mode: 'u=rwx,go=rx'
|
||||
owner: "{{ kafka_user }}"
|
||||
group: "{{ kafka_user }}"
|
||||
|
||||
- name: Link kafka to the right version
|
||||
become: yes
|
||||
file:
|
||||
path: "{{ kafka_install_folder }}/kafka"
|
||||
src: "{{ kafka_install_folder }}/{{ kafka_base_name }}"
|
||||
owner: "{{ kafka_user }}"
|
||||
group: "{{ kafka_user }}"
|
||||
state: link
|
||||
|
||||
- name: Add Zookeeper SystemD script
|
||||
become: yes
|
||||
template:
|
||||
dest: /etc/systemd/system/zookeeper.service
|
||||
mode: u+rw,g+rw,o+r
|
||||
src: zookeeper.service.j2
|
||||
|
||||
- name: Add Kafka SystemD script
|
||||
become: yes
|
||||
template:
|
||||
dest: /etc/systemd/system/kafka.service
|
||||
mode: u+rw,g+rw,o+r
|
||||
src: kafka.service.j2
|
||||
|
||||
- name: Ensure Kafka is enabled for SystemD
|
||||
become: yes
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: kafka
|
||||
enabled: yes
|
||||
|
||||
- name: Ensure Kafka is running
|
||||
become: yes
|
||||
service:
|
||||
enabled: yes
|
||||
name: kafka
|
||||
state: started
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
- name: Add an apt key for MongoDB
|
||||
become: yes
|
||||
apt_key:
|
||||
url: https://www.mongodb.org/static/pgp/server-4.4.asc
|
||||
state: present
|
||||
|
||||
- name: Add apt repository for MongoDB
|
||||
become: yes
|
||||
apt_repository:
|
||||
repo: "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/4.4 main"
|
||||
filename: mongodb-org-4.4
|
||||
update_cache: yes
|
||||
|
||||
- name: Install MongoDB
|
||||
become: yes
|
||||
apt:
|
||||
name: "mongodb-org"
|
||||
state: present
|
||||
|
||||
- name: Enable mongod service and ensure it is not masked
|
||||
become: yes
|
||||
systemd:
|
||||
name: mongod
|
||||
state: started
|
||||
enabled: yes
|
||||
masked: no
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
- name: Add an apt key by id for rabbitmq
|
||||
become: yes
|
||||
apt_key:
|
||||
url: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
|
||||
- https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
|
||||
- https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key
|
||||
|
||||
|
||||
- name: Install the apt-transport-https
|
||||
become: yes
|
||||
apt:
|
||||
name: apt-transport-https
|
||||
|
||||
- name: Add apt repository for erlang
|
||||
become: yes
|
||||
apt_repository:
|
||||
repo: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/debian {{ ansible_distribution_release }} main"
|
||||
filename: rabbitmq_erlang
|
||||
update_cache: no
|
||||
|
||||
- name: Add apt repository for rabbitmq
|
||||
become: yes
|
||||
apt_repository:
|
||||
repo: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/debian {{ ansible_distribution_release }} main"
|
||||
filename: rabbitmq_main
|
||||
update_cache: yes
|
||||
|
||||
- name: Install RabbitMQ
|
||||
become: yes
|
||||
apt:
|
||||
name: "rabbitmq-server"
|
||||
state: present
|
||||
@@ -1,13 +0,0 @@
|
||||
[Unit]
|
||||
Requires=network.target remote-fs.target
|
||||
After=network.target remote-fs.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ kafka_user }}
|
||||
ExecStart=/home/{{ kafka_user }}/kafka/bin/zookeeper-server-start.sh /home/{{ kafka_user }}/kafka/config/zookeeper.properties
|
||||
ExecStop=/home/{{ kafka_user }}/kafka/bin/zookeeper-server-stop.sh
|
||||
Restart=on-abnormal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user