From f951ce7597add1714d2a73ac59555e267d974adc Mon Sep 17 00:00:00 2001 From: southerntofu Date: Sat, 11 Apr 2020 23:00:17 +0000 Subject: [PATCH] =?UTF-8?q?Le=20playbook=20peut=20=C3=AAtre=20lanc=C3=A9?= =?UTF-8?q?=20en=20local=20avec=20./deploy.sh=20local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 23 +++++++++++++++++++++++ deploy.sh | 10 +++++++++- host_vars/127.0.0.1.yml | 1 + site.yml | 4 ++-- 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 120000 host_vars/127.0.0.1.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96d6c00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# ---> Vim +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# File created by runing the playbook locally +site.retry diff --git a/deploy.sh b/deploy.sh index 4e4c25d..a9009d5 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,2 +1,10 @@ #!/bin/bash -ansible-playbook -i hosts site.yml + +if [[ $1 = "test" ]]; then + ansible-playbook --check -i hosts site.yml +elif [[ $1 = "local" ]]; then + ansible-playbook --connection=local --inventory 127.0.0.1, --limit 127.0.0.1 \ + site.yml -i hosts +else + ansible-playbook -i hosts site.yml +fi diff --git a/host_vars/127.0.0.1.yml b/host_vars/127.0.0.1.yml new file mode 120000 index 0000000..1a04feb --- /dev/null +++ b/host_vars/127.0.0.1.yml @@ -0,0 +1 @@ +fr.yml \ No newline at end of file diff --git a/site.yml b/site.yml index d914d11..dc9b5e4 100644 --- a/site.yml +++ b/site.yml @@ -1,9 +1,9 @@ - name: Setup common utilities - hosts: fr + hosts: all roles: - common - name: Setup web server - hosts: fr + hosts: all roles: - webserver