mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Renamed variable in ansible script
This commit is contained in:
committed by
Dan Christian Bogos
parent
9a1099cd9a
commit
43856d055c
@@ -45,7 +45,7 @@
|
||||
###############################################################
|
||||
# CGRateS vars
|
||||
cgrates_dir: "{{ golang_gopath }}/src/github.com/cgrates/cgrates"
|
||||
cgrates_version: "v0.10"
|
||||
cgrates_branch: "v0.10"
|
||||
cgrates_distribution: "nightly"
|
||||
###############################################################
|
||||
######################## GPG Vars #############################
|
||||
@@ -134,7 +134,7 @@
|
||||
dest: '{{ cgrates_dir }}'
|
||||
update: yes
|
||||
force: yes
|
||||
version: "{{ cgrates_version }}"
|
||||
version: "{{ cgrates_branch }}"
|
||||
become: yes
|
||||
become_user: "{{ gouser }}"
|
||||
|
||||
@@ -193,8 +193,8 @@
|
||||
# get reprepro version
|
||||
- name: set cgrates distribution
|
||||
set_fact:
|
||||
cgrates_distribution: "{{ cgrates_version }}"
|
||||
when: cgrates_version != "master"
|
||||
cgrates_distribution: "{{ cgrates_branch }}"
|
||||
when: cgrates_branch != "master"
|
||||
|
||||
# Include the package with reprepro
|
||||
- name : Include the package with reprepro
|
||||
@@ -204,7 +204,7 @@
|
||||
args :
|
||||
chdir: /var/packages/debian
|
||||
with_items: '{{ changesFileNames.stdout_lines }}'
|
||||
when : cgrates_version == "master" or gitTagVar.stdout_lines|length > 0
|
||||
when : cgrates_branch == "master" or gitTagVar.stdout_lines|length > 0
|
||||
|
||||
# Move the file to PKG server
|
||||
- name: Copy the file to PKG server
|
||||
|
||||
@@ -12,7 +12,7 @@ Release: {{ releaseTag }}
|
||||
Summary: Carrier Grade Real-time Charging System
|
||||
License: GPLv3
|
||||
URL: https://github.com/cgrates/cgrates
|
||||
Source0: https://github.com/cgrates/cgrates/archive/{{ cgrates_version }}/{{ gitVersion.stdout_lines[0] }}.tar.gz
|
||||
Source0: https://github.com/cgrates/cgrates/archive/{{ cgrates_branch }}/{{ gitVersion.stdout_lines[0] }}.tar.gz
|
||||
|
||||
%if 0%{?fedora} > 16 || 0%{?rhel} > 6
|
||||
Requires(pre): shadow-utils
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
###############################################################
|
||||
# CGRateS location
|
||||
cgrates_dir: "{{ golang_gopath }}/src/github.com/cgrates/cgrates"
|
||||
cgrates_version: "v0.10"
|
||||
cgrates_branch: "v0.10"
|
||||
cgrates_distribution: "nightly"
|
||||
###############################################################
|
||||
##################### GPG Vars #############################
|
||||
@@ -91,8 +91,8 @@
|
||||
# get yum version
|
||||
- name: set cgrates distribution
|
||||
set_fact:
|
||||
cgrates_distribution: "{{ cgrates_version }}"
|
||||
when: cgrates_version != "master"
|
||||
cgrates_distribution: "{{ cgrates_branch }}"
|
||||
when: cgrates_branch != "master"
|
||||
|
||||
- name: Check if /var/packages/yum directory exists
|
||||
become: true
|
||||
@@ -167,7 +167,7 @@
|
||||
dest: '{{ cgrates_dir }}'
|
||||
update: yes
|
||||
force: yes
|
||||
version: "{{ cgrates_version }}"
|
||||
version: "{{ cgrates_branch }}"
|
||||
become: yes
|
||||
become_user: "{{ gouser }}"
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
- name: Download the tar.gz for the last commit
|
||||
become: yes
|
||||
get_url:
|
||||
url: https://github.com/cgrates/cgrates/archive/{{ cgrates_version }}/{{ gitVersion.stdout_lines[0] }}.tar.gz
|
||||
url: https://github.com/cgrates/cgrates/archive/{{ cgrates_branch }}/{{ gitVersion.stdout_lines[0] }}.tar.gz
|
||||
dest: cgr_build/SOURCES/{{ gitVersion.stdout_lines[0] }}.tar.gz
|
||||
|
||||
- name: Add cgrates.spec in SPECS
|
||||
@@ -264,30 +264,30 @@
|
||||
become: yes
|
||||
shell: 'sudo rpm --addsign cgr_build/RPMS/x86_64/{{ item }}'
|
||||
with_items: "{{ rmpFileName.stdout_lines }}"
|
||||
when : cgrates_version == "master" or gitTagVar.stdout_lines|length > 0
|
||||
when : cgrates_branch == "master" or gitTagVar.stdout_lines|length > 0
|
||||
|
||||
- name: Check if is something in /var/packages/yum/{{ cgrates_distribution }}
|
||||
become: yes
|
||||
shell : "ls /var/packages/yum/{{ cgrates_distribution }}/"
|
||||
register: yumFiles
|
||||
when : cgrates_version == "master" or gitTagVar.stdout_lines|length > 0
|
||||
when : cgrates_branch == "master" or gitTagVar.stdout_lines|length > 0
|
||||
|
||||
# Clean the folder
|
||||
- name: Clean the incoming folder
|
||||
become: yes
|
||||
shell: "sudo rm -rf /var/packages/yum/{{ cgrates_distribution }}/*"
|
||||
when: (cgrates_version == "master" or gitTagVar.stdout_lines|length > 0) and yumFiles.stdout_lines|length > 1
|
||||
when: (cgrates_branch == "master" or gitTagVar.stdout_lines|length > 0) and yumFiles.stdout_lines|length > 1
|
||||
|
||||
- name: Move the files to /var/packages/yum/{{ cgrates_distribution }}
|
||||
become: yes
|
||||
command: mv cgr_build/RPMS/x86_64/{{ item }} /var/packages/yum/{{ cgrates_distribution }}/
|
||||
with_items: "{{ rmpFileName.stdout_lines }}"
|
||||
when: (cgrates_version == "master" or gitTagVar.stdout_lines|length > 0) and rmpFileName.stdout_lines|length > 0
|
||||
when: (cgrates_branch == "master" or gitTagVar.stdout_lines|length > 0) and rmpFileName.stdout_lines|length > 0
|
||||
|
||||
- name: Include the package with createrepo
|
||||
become: yes
|
||||
shell: createrepo /var/packages/yum/{{ cgrates_distribution }}
|
||||
when : cgrates_version == "master" or gitTagVar.stdout_lines|length > 0
|
||||
when : cgrates_branch == "master" or gitTagVar.stdout_lines|length > 0
|
||||
|
||||
- name: Remove rpm files
|
||||
become: yes
|
||||
@@ -295,7 +295,7 @@
|
||||
path: cgr_build/RPMS/x86_64/{{ item }}
|
||||
state: absent
|
||||
with_items: "{{ rmpFileName.stdout_lines }}"
|
||||
when: cgrates_version != "master" and gitTagVar.stdout_lines|length == 0
|
||||
when: cgrates_branch != "master" and gitTagVar.stdout_lines|length == 0
|
||||
|
||||
- hosts: pkg
|
||||
remote_user: '{{ gouser }}'
|
||||
|
||||
Reference in New Issue
Block a user