Может кому пригодится, как в Debian ansible установка postgresql для 1C Предприятие 8.3.
Установка postgresql 12.7-5 на debian 10.
На Debian 11 не получилось установить.
Слишком старые библиотеки требуются для postgresql работы с 1с.
Рабочий playbook.
Запускаем.
$ ansible-playbook inst_pgsql
$ cat /etc/ansible/inst_pgsql - hosts: serv23 name: Install in Debian. gather_facts: true become: true vars: config_system_locale: 'ru_RU.UTF-8' config_system_language: 'ru_RU.UTF-8' ftp_server: 'https://my_ftp/distrib/pg1c' postresql_version: '12.7-5' postgres_password: '123456' pg_params: [] tasks: - name: Set timezone to Europe/Moscow timezone: name: Europe/Moscow # apt update upgrade - name: Update all packages to their latest version apt: update_cache: yes name: "*" state: latest # Устанавливаем локаль. - name: Ensure localisation files for '{{ config_system_locale }}' are available locale_gen: name: "{{ config_system_locale }}" state: present - name: Ensure localisation files for '{{ config_system_language }}' are available locale_gen: name: "{{ config_system_language }}" state: present - name: Get current locale and language configuration command: localectl status register: locale_status changed_when: false - name: Parse 'LANG' from current locale and language configuration set_fact: locale_lang: "{{ locale_status.stdout | regex_search('LANG=([^\n]+)', '\\1') | first }}" - name: Parse 'LANGUAGE' from current locale and language configuration set_fact: locale_language: "{{ locale_status.stdout | regex_search('LANGUAGE=([^\n]+)', '\\1') | default([locale_lang], true) | first }}" - name: Configure locale to '{{ config_system_locale }}' and language to '{{ config_system_language }}' command: localectl set-locale LANG={{ config_system_locale }} LANGUAGE={{ config_system_language }} changed_when: locale_lang != config_system_locale or locale_language != config_system_language # Устанавливаем доп пакеты - name: install packages apt: pkg: - postgresql-client-common - postgresql-common - libxslt1.1 - ssl-cert - libllvm6.0 - mc - python-pip - acl state: present # Устанавливаем доп пакеты которых нет в официальном репозитории. - name: install libicu55 apt: deb: '{{ item }}' with_items: - http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.5_amd64.deb - http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb # Устанавливаем пакеты postgresql. - name: install postresql apt: deb: '{{ item }}' with_items: - '{{ ftp_server }}/libpq5_{{ postresql_version }}.1C_amd64.deb' - '{{ ftp_server }}/postgresql-client-{{ postresql_version[:2] }}_{{ postresql_version }}.1C_amd64.deb' - '{{ ftp_server }}/postgresql-{{ postresql_version[:2] }}_{{ postresql_version }}.1C_amd64.deb' # Блокируем обновление пакетов установленных из .deb. - name: Hold packages dpkg_selections: name: '{{ item }}' selection: hold with_items: - libpq5 - postgresql-{{ postresql_version[:2] }} - postgresql-client-{{ postresql_version[:2] }} - libicu55 - libssl1.0.0 # Устанавливаем psycopg2, нужен для postgresql_user и postgresql_set. - name: Make sure psycopg2 is installed pip: name: psycopg2-binary state: present - name: Reset database user. become: yes become_method: sudo become_user: postgres postgresql_user: db: postgres user: postgres password: '{{ postgres_password }}' - name: Set postgres parametres. become: yes become_user: postgres postgresql_set: name: '{{ item. name }}' value: '{{ item. value }}' register: set with_items: '{{ pg_params }}' - name: Set postgres parametres. - lineinfile: dest=/etc/postgresql/12/main/pg_hba.conf line='host all all 10.10.2.15 md5' - name: Restart service postgresql. service: name: postgresql state: restarted
Вот и вся инструкция как в системе Debian ansible установка postgresql 1C Предприятие 8.3 установить.