From 0c6ffc6dbd691f940f59083dbfc405530b04f174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 31 Oct 2021 13:24:43 +0100 Subject: [PATCH] Read variables from separate file --- playbook.yml | 32 ++++++-------------------------- user.yml | 12 ------------ variables.yml | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 38 deletions(-) create mode 100644 variables.yml diff --git a/playbook.yml b/playbook.yml index 05c3d63..3184b36 100644 --- a/playbook.yml +++ b/playbook.yml @@ -10,6 +10,12 @@ tags: - always + - name: read variables + include_vars: + file: variables.yml + tags: + - always + - set_fact: distro: "{{ ansible_distribution|lower }}" tags: @@ -412,28 +418,6 @@ become: true become_user: rust_build - - name: set crate list - set_fact: - cargo_crate_list: - - crate: just - binary: just - version: 0.10.2 - - crate: ripgrep - binary: rg - version: 13.0.0 - - crate: fd-find - binary: fd - version: 8.2.1 - - crate: bat - binary: bat - version: 0.18.3 - - crate: exa - binary: exa - version: 0.10.1 - - crate: watchexec-cli - binary: watchexec - version: 1.17.1 - - name: build rust crates shell: | set -o errexit @@ -478,10 +462,6 @@ - rust_binaries - block: - - name: set go version - set_fact: - go_version: "1.17.1" - - name: stat go target directory stat: path: /usr/local/go-v{{ go_version }} diff --git a/user.yml b/user.yml index fbc6e02..afc701f 100644 --- a/user.yml +++ b/user.yml @@ -477,10 +477,6 @@ - firefox - block: - - name: set portfolio performance version - set_fact: - portfolio_performace_version: "0.55.0" - - name: look of current installation stat: path: /home/{{ user.name }}/.opt/portfolio-performance-{{ portfolio_performace_version }} @@ -542,10 +538,6 @@ - portfolio-performance - block: - - name: set kubectl version - set_fact: - kubectl_version: v1.22.2 - - name: get current stable version uri: url: https://storage.googleapis.com/kubernetes-release/release/stable.txt @@ -588,10 +580,6 @@ - kubectl - block: - - name: set terraform version - set_fact: - terraform_version: 1.0.2 - - name: stat current terraform binary stat: path: "/home/{{ user.name }}/.opt/terraform-v{{ terraform_version }}" diff --git a/variables.yml b/variables.yml new file mode 100644 index 0000000..2caf47c --- /dev/null +++ b/variables.yml @@ -0,0 +1,23 @@ +terraform_version: 1.0.2 +kubectl_version: v1.22.2 +go_version: "1.17.1" +portfolio_performace_version: "0.55.0" +cargo_crate_list: + - crate: just + binary: just + version: 0.10.2 + - crate: ripgrep + binary: rg + version: 13.0.0 + - crate: fd-find + binary: fd + version: 8.2.1 + - crate: bat + binary: bat + version: 0.18.3 + - crate: exa + binary: exa + version: 0.10.1 + - crate: watchexec-cli + binary: watchexec + version: 1.17.1