From 941ee55fab48f09a5cda49b8fec9f03100a19f3d Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Wed, 23 Oct 2024 19:37:13 +0300 Subject: [PATCH] Remove unused ansible files all of them replaced by roles --- data/ansible/integration_tests/README.md | 19 --- data/ansible/integration_tests/elasic.yaml | 37 ------ data/ansible/integration_tests/go.yaml | 122 ------------------ data/ansible/integration_tests/golang.sh.j2 | 12 -- .../integration_tests/kafka.service.j2 | 13 -- data/ansible/integration_tests/kafka.yaml | 81 ------------ data/ansible/integration_tests/mongo.yaml | 27 ---- data/ansible/integration_tests/rabbitmq.yaml | 36 ------ .../integration_tests/zookeeper.service.j2 | 13 -- 9 files changed, 360 deletions(-) delete mode 100644 data/ansible/integration_tests/README.md delete mode 100644 data/ansible/integration_tests/elasic.yaml delete mode 100644 data/ansible/integration_tests/go.yaml delete mode 100644 data/ansible/integration_tests/golang.sh.j2 delete mode 100644 data/ansible/integration_tests/kafka.service.j2 delete mode 100644 data/ansible/integration_tests/kafka.yaml delete mode 100644 data/ansible/integration_tests/mongo.yaml delete mode 100644 data/ansible/integration_tests/rabbitmq.yaml delete mode 100644 data/ansible/integration_tests/zookeeper.service.j2 diff --git a/data/ansible/integration_tests/README.md b/data/ansible/integration_tests/README.md deleted file mode 100644 index 9cd0ae5a6..000000000 --- a/data/ansible/integration_tests/README.md +++ /dev/null @@ -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! diff --git a/data/ansible/integration_tests/elasic.yaml b/data/ansible/integration_tests/elasic.yaml deleted file mode 100644 index 2c84cb90f..000000000 --- a/data/ansible/integration_tests/elasic.yaml +++ /dev/null @@ -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 diff --git a/data/ansible/integration_tests/go.yaml b/data/ansible/integration_tests/go.yaml deleted file mode 100644 index c08fae40b..000000000 --- a/data/ansible/integration_tests/go.yaml +++ /dev/null @@ -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 diff --git a/data/ansible/integration_tests/golang.sh.j2 b/data/ansible/integration_tests/golang.sh.j2 deleted file mode 100644 index 7bfc41c2e..000000000 --- a/data/ansible/integration_tests/golang.sh.j2 +++ /dev/null @@ -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 %} \ No newline at end of file diff --git a/data/ansible/integration_tests/kafka.service.j2 b/data/ansible/integration_tests/kafka.service.j2 deleted file mode 100644 index 9c435ba34..000000000 --- a/data/ansible/integration_tests/kafka.service.j2 +++ /dev/null @@ -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 \ No newline at end of file diff --git a/data/ansible/integration_tests/kafka.yaml b/data/ansible/integration_tests/kafka.yaml deleted file mode 100644 index 4967610d6..000000000 --- a/data/ansible/integration_tests/kafka.yaml +++ /dev/null @@ -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 diff --git a/data/ansible/integration_tests/mongo.yaml b/data/ansible/integration_tests/mongo.yaml deleted file mode 100644 index b6ca5fa80..000000000 --- a/data/ansible/integration_tests/mongo.yaml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/data/ansible/integration_tests/rabbitmq.yaml b/data/ansible/integration_tests/rabbitmq.yaml deleted file mode 100644 index affdb64e9..000000000 --- a/data/ansible/integration_tests/rabbitmq.yaml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/data/ansible/integration_tests/zookeeper.service.j2 b/data/ansible/integration_tests/zookeeper.service.j2 deleted file mode 100644 index ba37856c0..000000000 --- a/data/ansible/integration_tests/zookeeper.service.j2 +++ /dev/null @@ -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 \ No newline at end of file