apt-get install git git clone https://github.com/auteam-usr/moscow39.git cd moscow39 docker build -t localhost:5000/app1:latest . docker push localhost:5000/app1:latest шаблон конфигурации балансировщика: /home/altlinux/haproxy.cfg frontend https
bind *:80
bind *:443 ssl crt /etc/haproxy/server.pem
http-request redirect scheme https unless { ssl_fc }
default_backend app1
backend app1
balance roundrobin
server web1 10.1.1.1:80 check
server web2 10.1.1.2:80 check apt-get install ansible
Inventory: /etc/ansible/hosts [Balancer] интернет_адрес_балансировщика [Webs] интернет_адрес_веб1 интернет_адрес_веб2 Плейбук: /etc/ansible/infra.yml - name: Haproxy tasks
hosts: Balancer
tasks:
- name: Install haproxy
apt_rpm:
name: haproxy
state: present
update_cache: yes
- name: Copy cert
copy:
src=/home/altlinux/server.pem
dest=/etc/haproxy/server.pem
- name: Config haproxy
blockinfile:
dest: /etc/hap