Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add when condition for ppa certbot because don't work on jammy #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .binenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vagrant=2.3.0
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box = "ubuntu/jammy64"
config.vm.define "haproxy" do |haproxy|
end

Expand All @@ -9,7 +9,7 @@ Vagrant.configure(2) do |config|

config.vm.provision "shell",
:path => "vagrant_specs.sh",
:upload_path => "/home/ubuntu/specs",
:upload_path => "/home/vagrant/specs",
# change role name below
:args => "--install ansible-haproxy"
end
4 changes: 3 additions & 1 deletion tasks/letsencrypt-lua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
repo: "ppa:certbot/certbot"
state: present
update_cache: yes
ignore_errors: true
when: ansible_distribution == "Ubuntu"
register: __haproxy_le_ppa_certbot

- name: Installs python-certbot
apt:
Expand All @@ -17,7 +19,7 @@
pkg: certbot
state: present
ignore_errors: true
when: __haproxy_le_python_certbot is failed
when: __haproxy_le_python_certbot is failed or __haproxy_le_ppa_certbot is failed

- name: Creates certificate & lua dirs in haproxy config dir
file:
Expand Down
9 changes: 6 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

---
- include_tasks:
- name: Include check_vars
include_tasks:
file: check_vars.yml
apply:
tags:
Expand All @@ -9,15 +10,17 @@
tags:
- always

- include_tasks:
- name: Include haproxy
include_tasks:
file: haproxy.yml
apply:
tags:
- haproxy
tags:
- always

- include_tasks:
- name: Include letsencrypt-lua
include_tasks:
file: letsencrypt-lua.yml
apply:
tags:
Expand Down
2 changes: 1 addition & 1 deletion tests/ansible-haproxy/defaults.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
test_ansible_version="stable-1.9"
test_ansible_version="v2.8.20"
19 changes: 10 additions & 9 deletions vagrant_specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
# vagrant ssh -c ./specs
#
if [ "x$1" == "x--install" ]; then
mv ~ubuntu/specs /usr/local/bin/specs
mv ~vagrant/specs /usr/local/bin/specs
chmod 755 /usr/local/bin/specs
sudo apt-get install -qqy git make python
su ubuntu -c 'git clone --depth 1 https://github.com/nickjj/rolespec'
cd ~ubuntu/rolespec && make install
su ubuntu -c 'rolespec -i ~/testdir'
su ubuntu -c "ln -s /vagrant/ ~/testdir/roles/$2"
su ubuntu -c "ln -s /vagrant/tests/$2/ ~/testdir/tests/"
# su ubuntu -c "git clone $3 ~/testdir/tests"
sudo apt-get install -qqy git make python3
sudo ln -sfn /usr/bin/python3 /usr/bin/python
su vagrant -c 'git clone --depth 1 https://github.com/nickjj/rolespec'
cd ~vagrant/rolespec && make install
su vagrant -c 'rolespec -i ~/testdir'
su vagrant -c "ln -s /vagrant/ ~/testdir/roles/$2"
su vagrant -c "ln -s /vagrant/tests/$2/ ~/testdir/tests/"
# su vagrant -c "git clone $3 ~/testdir/tests"
exit
fi

cd ~ubuntu/testdir && rolespec -r $(ls roles) "$*"
cd ~vagrant/testdir && rolespec -r $(ls roles) "$*"