From f676f207d909e5ecab920f10b92b819a45ae6325 Mon Sep 17 00:00:00 2001 From: Frank Kloeker Date: Sun, 27 Jan 2019 10:52:40 +0100 Subject: [PATCH] Improve generate_atc Ansible playbook - fetch project list automatically - provide test data (not sure if we can provide real data which are already published in governance repo and wiki) Change-Id: I1c2144f794932048ce3c8cf26f3457abaa3dec34 --- .gitignore | 3 +++ playbooks/generate_atc.yml | 17 +++++++++++++---- playbooks/vars/zanata_stats_output.csv | 3 +++ playbooks/vars/zanata_userinfo_output.csv | 3 +++ 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 playbooks/vars/zanata_stats_output.csv create mode 100644 playbooks/vars/zanata_userinfo_output.csv diff --git a/.gitignore b/.gitignore index 5f9050e..11a9ba6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ dist/ # Testenvironment .tox/ + +# Retry files form Ansible +*.retry diff --git a/playbooks/generate_atc.yml b/playbooks/generate_atc.yml index 73b33bd..833cb99 100644 --- a/playbooks/generate_atc.yml +++ b/playbooks/generate_atc.yml @@ -17,15 +17,15 @@ # usage: ansible-playbook generate_atc.yml # # The output can be found in /tmp/atc.stats +# +# The full workflow is described in https://wiki.openstack.org/wiki/I18n_Extra-ATC_collection - hosts: localhost gather_facts: "no" vars: - userstatsfile: "zanata_stats_output.csv" - userinfofile: "zanata_userinfo_output.csv" + userstatsfile: "vars/zanata_stats_output.csv" + userinfofile: "vars/zanata_userinfo_output.csv" translatecount: 300 workingdir: "/tmp/atc.output" - vars_files: - - "projects.yaml" tasks: - name: create working dir @@ -33,6 +33,15 @@ path: "{{ workingdir }}" state: directory + - name: fetch projects list + get_url: + url: https://git.openstack.org/cgit/openstack/governance/plain/reference/projects.yaml + dest: vars/ + force: True + + - name: include projects.yaml var + include_vars: vars/projects.yaml + - name: read old atc list vars: extraatcs: "{{ I18n['extra-atcs'] }}" diff --git a/playbooks/vars/zanata_stats_output.csv b/playbooks/vars/zanata_stats_output.csv new file mode 100644 index 0000000..6003b2c --- /dev/null +++ b/playbooks/vars/zanata_stats_output.csv @@ -0,0 +1,3 @@ +user_id,lang,project,version,translation-total,translated,needReview,approved,rejected,review-total,review-approved,review-rejected +user1,zh-CN,-,-,130,130,0,0,0,0,0,0 +user2,de,-,-,10000,10000,2,1,0,1,1,0 diff --git a/playbooks/vars/zanata_userinfo_output.csv b/playbooks/vars/zanata_userinfo_output.csv new file mode 100644 index 0000000..5f5832e --- /dev/null +++ b/playbooks/vars/zanata_userinfo_output.csv @@ -0,0 +1,3 @@ +user_id,lang_code,lang,name,email +user1,zh-CN,Chinese (China),User One,user1@example.com +user2,de,German,User Two,user2@example.com