SlideShare a Scribd company logo
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
2/122
Agenda
●
What is PostgreSQL
●
What is Ansible
●
Ansible Ad-hoc
●
Ansible Playbooks
●
Bring it all together
●
Run it automated
●
Summary
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
3/122
Andreas Scherbaum
●
Working with databases since 1997, with PostgreSQL since 1998
●
Founding member of the European and German PostgreSQL User Group
●
Board of Directors – European PostgreSQL User Group
●
Organizing pgconf.eu, pgconf.de, FOSDEM PGDay
●
Regional Contact PostgreSQL for Germany
●
Ran my own company for 7+ years – around PostgreSQL
●
Wrote a book about PostgreSQL (in German)
●
Worked for EMC/Pivotal from 2011 – August 2020
●
Joined Adjust in September 2020
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
4/122
Get Social ...
●
Twitter, Instagram & Tumblr: @ascherbaum
●
LinkedIn: https://www.linkedin.com/in/andreas-scherbaum-87b6663/
●
Mastadon: https://mastodon.social/@ascherbaum
●
Diaspora: ads@pluspora.com
●
Blog: https://andreas.scherbaum.la/

Recommended for you

ansible why ?
ansible why ?ansible why ?
ansible why ?

This document contains information about the sys/net/sec admin Yashar Esmaildokht, including their contact information and websites. It then provides a brief overview of the open-source automation tool Ansible, describing its main features and uses for configuration management, application deployment, and cloud provisioning. Requirements and versions of Ansible are listed. The document concludes with examples of Ansible concepts including playbooks, tasks, modules, variables, and host inventory organization.

Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례

[Open Infrastructure & Cloud Native Days Korea 2019] 커뮤니티 버전의 OpenStack 과 Ceph를 활용하여 대고객서비스를 구축한 사례를 공유합니다. 유연성을 확보한 기업용 클라우드 서비스 구축 사례와 높은 수준의 보안을 요구하는 거래소 서비스를 구축, 운영한 사례를 소개합니다. 또한 이 프로젝트에 사용된 기술 스택 및 장애 해결사례와 최적화 방안을 소개합니다. 오픈스택은 역시 오픈소스컨설팅입니다. #openstack #ceph #openinfraday #cloudnative #opensourceconsulting

openstackcephopeninfraday
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識

社内勉強会資料。 Hadoopの概要について説明。

hadoop
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
6/122
Source: unknown
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
8/122
Ansible
●
Ansible is:
– Fictional device for superluminal communication
●
Can send and receive messages without delay, over any
distance
●
From the 1966 novel “Rocannon’s World” by Ursula le
Guin
●
Later adapted by other science fiction, most notably:
“Ender’s Game”

Recommended for you

AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
gamesamazon elastic compute cloudaws
Linux Performance Analysis and Tools
Linux Performance Analysis and ToolsLinux Performance Analysis and Tools
Linux Performance Analysis and Tools

Video: http://joyent.com/blog/linux-performance-analysis-and-tools-brendan-gregg-s-talk-at-scale-11x ; This talk for SCaLE11x covers system performance analysis methodologies and the Linux tools to support them, so that you can get the most out of your systems and solve performance issues quickly. This includes a wide variety of tools, including basics like top(1), advanced tools like perf, and new tools like the DTrace for Linux prototypes.

perflinuxdtrace
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)

2014-05-31 JPUG第29回 しくみ+アプリケーション分科会で使用したスラ���ドです。

postgresqlbackuprecovery
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
9/122
Ansible
●
Ansible is:
– Open Source software for provisioning, configuration management, and application
deployment
– Manages many systems in parallel, by executing tasks over [ssh|Windows Remote
Management|PowerShell]
– Manages Unix-like and Microsoft Windows systems
●
Ansible host has to be Unix/Linux
– Under development since 2012, acquired by Red Hat in 2015
●
Current stable version: 2.10.x
– Python knowledge useful, but not required
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
10/122
Ansible Advantages
●
Code = Documentation
– If done properly
●
Playbooks are idempotent
– Can be re-run any time, only change what’s necessary
●
Can deploy and manage large clusters of machines in parallel
●
Playbooks can be run from multiple locations
– As long as access is handled
– No host agent necessary
●
Extensive and powerful variable and template handling
●
Requirements: Python (v3)
– Some Ansible modules require additional Python modules
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
11/122
Ansible
Ansible
Controller
Host 1
Webserver
Host 2
Webserver
Host 3
Database
Host 4
Load
Balancer
ssh
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
12/122
Ansible Modules
●
Database: PostgreSQL, MongoDB, MS SQL, MySQL,
InfluxDB, …
●
Files: fetch, copy, template, find, file, acl, archive, patch,
archive, xml, xattr, …
●
Network: AWS, GPC, [Switches], [Firewalls], [Loadbalancers]
●
Storage, Notification, Crypto, Cloud, Source Control, ...
●
Expandable!

Recommended for you

Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Aurora Deep Dive (db tech showcase 2016)Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Aurora Deep Dive (db tech showcase 2016)

2016/07/15のdb tech showcase 2016講演資料です

amazonawsaurora
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)

PostgreSQLのfull_page_writesについて (第24回PostgreSQLアンカンファレンス@オンライン 発表資料) 2021年6月8日 株式会社NTTデータ 技術開発本部 先進コンピューティング技術センタ 藤井 雅雄

nttdatanttデータpostgresql
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
13/122
Ansible
Ansible
Controller
Host 1
Webserver
Host 2
Webserver
Host 3
PostgreSQL
Host 4
Load
Balancer
ssh
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
14/122
Ansible PostgreSQL Modules (as of v2.10)
●
Manage: databases, roles (user), membership, owner, schema,
extensions, languages, privileges, publications, sequences,
tables, indexes, replication slots
●
Information: retrieve information about PG servers, ping servers
●
pg_hba: manage access control
●
Query: run queries against the database, or COPY data
●
Many of the useful modules are available starting with version 2.8
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
16/122
Ad-hoc queries
●
Ansible allows to run ad-hoc commands against any given host
or host group
– Example: ping (check if host is alive, and Ansible can login)

Recommended for you

オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...

オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~ (第34回PostgreSQLアンカンファレンス@オンライン 発表資料) 2022年7月29日 NTTデータ 技術開発本部 先進コンピューティング技術センタ 藤井 雅雄

postgresqlbackupnttdata
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바

사례로 알아보는 MariaDB 마이그레이션 현대적인 IT 환경과 애플리케이션을 만들기 위해 우리는 오늘도 고민을 거듭합니다. 최근 들어 오픈소스 DB가 많은 업무에 적용되고 검증이 되면서, 점차 무거운 상용 데이터베이스를 가벼운 오픈소스 DB로 전환하는 움직임이 대기업의 미션 크리티컬 업무까지로 확산하고 있습니다. 이는 클라우드 환경 및 마이크로 서비스 개념 확산과도 일치하는 움직임입니다. 상용 DB를 MariaDB로 이관한 사례를 통해 마이그레이션의 과정과 효과를 살펴 볼 수 있습니다. MariaDB로 이관하는 것은 어렵다는 생각을 막연히 가지고 계셨다면 본 자료를 통해 이기종 데이터베이스를 MariaDB로 마이그레이션 하는 작업이 어렵지 않게 수행될 수 있다는 점을 실�� 사례를 통해 확인하시길 바랍니다. 웨비나 동영상 https://www.youtube.com/watch?v=xRsETZ5cKz8&t=52s

opensourcedatabasemariadb
NetApp XCP データ移行ツールインストールと設定
NetApp XCP データ移行ツールインストールと設定NetApp XCP データ移行ツールインストールと設定
NetApp XCP データ移行ツールインストールと設定

NASからデータを移行するためのツールの紹介とインストール方法を記載しています。移行元のNASのストレージの種類は選ばず、NFS to NFS, CIFS to CIFSで移行できます。オンプレからクラウド上のNASサービスに移行する際にも利用できます。

xcpnetappデータ移行
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
17/122
ping
ansible -i 127.0.0.1, -m ping all
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
18/122
ping
ansible -i 127.0.0.1, -m ping all
Inventory
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
19/122
ping
ansible -i 127.0.0.1, -m ping all
Inventory Hostlist
(as Python list,
with comma)
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
20/122
ping
ansible -i 127.0.0.1, -m ping all

Recommended for you

Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan

We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time (video http://galeracluster.com/videos/using-galera-replication-to-create-geo-distributed-clusters-on-the-wan-webinar-video-3/)

wan clustergalera cloud clustergalera cluster
MongoDB Database Replication
MongoDB Database ReplicationMongoDB Database Replication
MongoDB Database Replication

Database replication involves keeping identical copies of data on different servers to provide redundancy and minimize downtime. Replication is recommended for databases in production from the start. A MongoDB replica set consists of a primary server that handles client requests and secondary servers that copy the primary's data. Replica sets can include up to 50 members with 7 voting members and use an oplog to replicate operations from the primary to secondaries. For elections and writes to succeed, a majority of voting members must be reachable.

durabilitydata replicationmongodb
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators

Spencer Christensen There are many aspects to managing an RDBMS. Some of these are handled by an experienced DBA, but there are a good many things that any sys admin should be able to take care of if they know what to look for. This presentation will cover basics of managing Postgres, including creating database clusters, overview of configuration, and logging. We will also look at tools to help monitor Postgres and keep an eye on what is going on. Some of the tools we will review are: * pgtop * pg_top * pgfouine * check_postgres.pl. Check_postgres.pl is a great tool that can plug into your Nagios or Cacti monitoring systems, giving you even better visibility into your databases.

pgeast 2010postgresqlwwwpostgresqlconferenceorg
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
21/122
ping
ansible -i 127.0.0.1, -m ping all
Module
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
22/122
ping
ansible -i 127.0.0.1, -m ping all
Module Module
Name
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
23/122
ping
ansible -i 127.0.0.1, -m ping all
Module Module
Name
Servers
(all)
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
24/122
ping - pong
ansible -i 127.0.0.1, -m ping all
127.0.0.1 | SUCCESS => {
"ansible_facts": {
...
},
"changed": false,
"ping": "pong"
}

Recommended for you

ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL

High Availability proxy designed to solve real issues of MySQL setups from small to very large production environments. Presentation at Percona Live Amsterdam 2015

database mysql proxy ha performance
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)

29回勉強会資料「PostgreSQLのリカバリ超入門」 See also http://www.interdb.jp/pgsql (Coming soon!) 初心者向け。PostgreSQLのWAL、CHECKPOINT、 オンラインバックアップの仕組み解説。 これを見たら、次は→  http://www.slideshare.net/satock/29shikumi-backup

postgresql wal checkpoint online recovery redo
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA

This document provides a summary of a presentation on becoming an accidental PostgreSQL database administrator (DBA). It covers topics like installation, configuration, connections, backups, monitoring, slow queries, and getting help. The presentation aims to help those suddenly tasked with DBA responsibilities to not panic and provides practical advice on managing a PostgreSQL database.

Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
25/122
Password-less login
●
Ansible needs to be able to login without password
– For the regular user
– And the root method (sudo, su), if necessary
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
26/122
Module parameters
ansible -i 127.0.0.1, -m command -a “uptime” all
Additional
Module
Parameters
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
27/122
Module output
ansible -i 127.0.0.1, -m command -a “uptime” all
127.0.0.1 | CHANGED | rc=0 >>
23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
28/122
Module output
ansible -i 127.0.0.1, -m command -a “uptime” all
127.0.0.1 | CHANGED | rc=0 >>
23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27
Command Output

Recommended for you

Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014

This document describes how Brainly, a social network for homework help, automated their infrastructure using Ansible. It discusses how they migrated from custom scripts and packaging to using Ansible for configuration management. Key areas automated include Apache, DNS, user management, backups, monitoring with Icinga, clustering with Corosync/Pacemaker, firewalls, and scaling their infrastructure across multiple markets. While Ansible worked well overall, some challenges included complex templates, limitations of Jinja2, and lack of Python integration in roles.

ansible automation
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach

This document summarizes Brainly's use of Ansible for infrastructure automation. Key points include: - Brainly uses Ansible to configure over 1000 Linux containers running Debian and Ubuntu. - Ansible is used to automate configuration of services like Nagios monitoring, Apache, Erlang, Icinga, Corosync/Pacemaker, backups, firewalls and networking. - Roles, playbooks, policies and guidelines are stored in an Ansible repo to standardize processes and onboard new team members. - Ansible improved productivity, deployment speed and cooperation between dev and ops teams.

ansibleplnogautomation
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainly

This document summarizes Brainly's use of Ansible for infrastructure automation. Key points include: - Brainly uses Ansible to configure over 1000 Linux containers running various services. - Ansible is used to automate setup of services like Nagios monitoring, Apache, DNS, backups, firewalls, and more. - Custom scripts were integrated with Ansible to improve reusability and standardization. - Dynamic inventory scripts were developed to simplify host and group management across hundreds of servers.

ansibleautomationbrainly
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
29/122
Module Return Code
ansible -i 127.0.0.1, -m command -a “uptime” all
127.0.0.1 | CHANGED | rc=0 >>
23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27
Command Return Code
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
30/122
Module output
ansible -i 127.0.0.1, -m command -a “uptime” all
127.0.0.1 | CHANGED | rc=0 >>
23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27
“Something” changed
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
31/122
Command output
●
Ansible fetches STDOUT and STDERR from the remote host
●
Shows both to the user, in Ad-hoc mode
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
32/122
Command Result
●
Ansible provides the command return code (RC)
●
Playbooks can act on the RC
– ignore_errors: true
– failed_when: <condition>

Recommended for you

Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL Extensions

The document discusses useful PostgreSQL extensions. It begins by introducing the author and explaining what extensions are in PostgreSQL. It then outlines some well-known extensions included in the PostgreSQL core like hstore and postgres_fdw. The document also discusses where to find other extensions, such as on pgxn.org and pgfoundry.org, and highlights several popular extensions including PostGIS, PgRouting, mongres, pgfincore, pg_partman, and oracle_fdw.

 
by EDB
postgrespostgresql administrationpostgresql
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016

This document discusses managing PostgreSQL databases using Ansible. It begins with an introduction to Ansible and its key components like inventory, modules, tasks, variables, templates and playbooks. It then demonstrates how to install and use Ansible to provision Amazon EC2 instances, install PostgreSQL packages, setup streaming replication with a master and two standby servers, and add a new standby server. Various PostgreSQL and AWS-specific Ansible modules are also described.

demopostgresqldevops
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes][BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]

Wong Hoi Sing presented on hosting multiple websites on a single Kubernetes cluster. He discussed how virtual hosting traditionally works using a single or multiple servers. He then explained how Kubernetes and related tools like Ansible, CephFS, and Docker can provide a simpler and more scalable approach. Key aspects included using Kubernetes namespaces for isolation, CephFS for shared storage, automated deployment with Ansible, and demos of deploying Drupal on the cluster. Tips were also provided on optimizing applications, databases and caching.

kubernetescephvirtual hosting
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
33/122
Changes
●
Every time Ansible changes something on the host, the status
of the task becomes “changed”
– Can be ignored with “changed_when: false”
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
34/122
“command” versus “shell”
●
Ansible has 2 modules for executing arbitrary commands on the host:
●
command: no variable replacement is done, no filehandle redirects (like:
2> /dev/null) are possible, only one command possible – uses “exec”
●
shell: uses a regular shell to execute the command, can handle all kind
of variables, or multiple shell commands – uses “system”
– cat /etc/passwd | grep root | cut -f3 -d:
●
Both modules (by default) “change” the remote system
– Ansible doesn’t know what the module is executing
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
35/122
“command” / “shell” versus modules
●
Always aim to use Ansible modules over of “shell”/”command”
●
Modules provide idempotence:
– Multiple calls to the same module will not change the remote
system
 Managing PostgreSQL with Ansible

Recommended for you

Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak

Uphill battle against large enterprise it environments and IT corporate culture. How those difficulties turned out opportunities and clever implementations. Interesting modules, integrations and workflow pieces.

linux polskanetways2013
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises

"Workflow story: Theory versus practice in Large Enterprises" by Marcin Piebiak of Linux Polska at Puppet Camp London 2013.

workflowconfiguration managementlarge enterprise
Postgres Deployment Automation with Terraform and Ansible
 Postgres Deployment Automation with Terraform and Ansible Postgres Deployment Automation with Terraform and Ansible
Postgres Deployment Automation with Terraform and Ansible

This document provides an overview of PostgreSQL deployment automation using Terraform and Ansible. It begins with a brief introduction of Ansible and Terraform. It then describes EDB's open source projects for PostgreSQL deployment automation, including features and capabilities. The document reviews deployment automation capabilities with Ansible such as configuring repositories, installing database packages, initializing databases, setting up replication, and managing database servers. It also discusses deployment automation with Terraform for provisioning infrastructure on public clouds like AWS, Azure, and GCP. Finally, it presents the roadmap for future features.

 
by EDB
postgrespostgresqlpostgres build
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
37/122
Playbooks
●
A Playbook is a text file (Yaml format) with tasks
– Can run repeatedly - idempotent
●
Playbooks can become very large, and complex
– Split them up into roles (not topic of this talk)
●
Playbooks can run on parts of the infrastructure
– Example: only database hosts
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
38/122
Hosts list
●
The file “hosts.cfg” in the Playbook directory defines the hosts
●
Variables can be specified
– Per host
– Per host group
– …
– Global
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
39/122
hosts.cfg (Example)
[all-systems:children]
webservers
databases
[all-systems:vars]
ssh_args = -o ServerAliveInterval=30
[databases]
192.168.0.5 hostname=db1
[databases:vars]
db_type=postgresql
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
40/122
hosts.cfg
[all-systems:children]
webservers
databases
[all-systems:vars]
ssh_args = -o ServerAliveInterval=30
[databases]
192.168.0.5 hostname=db1
[databases:vars]
db_type=postgresql
Specify groups

Recommended for you

Managing Postgres with Ansible
Managing Postgres with AnsibleManaging Postgres with Ansible
Managing Postgres with Ansible

This document discusses using Ansible to manage PostgreSQL databases. It begins with an introduction to Ansible, explaining that it is an agentless automation tool used for configuration management, deployment, and orchestration. It then provides an overview of installing and using Ansible to provision infrastructure on Amazon Web Services and install PostgreSQL with streaming replication across multiple servers. Key components of Ansible like templates, variables, tasks, and playbooks are demonstrated in an example repository for automating PostgreSQL configuration management.

devopspostgresqlautomation
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible

- A playbook is defined to check if a pattern is present in the content of a web page retrieved from localhost. The playbook registers the content and fails if the defined pattern is not found. - The playbook is modified to define different patterns for different host groups - the groups "prod" and "recette" would each have their own unique pattern to check for. - The playbook uses Ansible modules like uri to retrieve a web page, register to store the content, and fail if a registered pattern is not found in the content. Variables and conditionals allow defining patterns dynamically based on host groups.

dockerscalaircontinuous integration
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects

Presentationslides from the GR8Conf presentation. Find the abstract here: http://gr8conf.eu/Presentations/my-perfect-grails-toolchain

grailsgr8confsetup
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
41/122
hosts.cfg
[all-systems:children]
webservers
databases
[all-systems:vars]
ssh_args = -o ServerAliveInterval=30
[databases]
192.168.0.5 hostname=db1
[databases:vars]
db_type=postgresql
Variables for
all child groups
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
42/122
hosts.cfg
[all-systems:children]
webservers
databases
[all-systems:vars]
ssh_args = -o ServerAliveInterval=30
[databases]
192.168.0.5 hostname=db1
[databases:vars]
db_type=postgresql
Database group
with one host
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
43/122
hosts.cfg
[all-systems:children]
webservers
databases
[all-systems:vars]
ssh_args = -o ServerAliveInterval=30
[databases]
192.168.0.5 hostname=db1
[databases:vars]
db_type=postgresql Variables for
database group
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
44/122
Playbook
●
Specifies task groups (Plays)
●
Goal is to group hosts together, and run Plays on them
●
Ansible wants Playbooks to be idempotent:
– Run many times, only change what is necessary
– Ansible modules are idempotent
– shell/command is not

Recommended for you

MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database

Save 10% off ANY FITC event with discount code 'slideshare' See our upcoming events at www.fitc.ca OVERVIEW The presentation will present an overview of the MongoDB NoSQL database, its history and current status as the leading NoSQL database. It will focus on how NoSQL, and in particular MongoDB, benefits developers building big data or web scale applications. Discuss the community around MongoDB and compare it to commercial alternatives. An introduction to installing, configuring and maintaining standalone instances and replica sets will be provided. Presented live at FITC's Spotlight:MEAN Stack on March 28th, 2014. More info at FITC.ca

 
by FITC
mongodbnosqldatabase
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our Wishbone

Ansible is a radically simple IT automation tool that helps automate infrastructure provisioning, application deployment, and orchestration of tasks. The presenter discusses how his team was spending too much time on repetitive database administration tasks manually. They discovered Ansible as a solution to automate these tasks. Using Ansible, they were able to define inventory, write idempotent playbooks using tasks, handlers, templates and variables. This improved performance and reliability by ensuring all environments were configured consistently and freeing up time from manual work. Moving forward, they aim to further develop roles and automate additional database management tasks like query tuning and self-healing using Ansible.

devopsmysqlansible
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)

How Ansible help to manage DBA Task and what are the best practices we followed are shared in this presentation.

ansiblelinuxmysql
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
45/122
Playbook
---
- hosts: databases
tasks:
- name: uptime
command: uptime
- name: uname
command: uname
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
46/122
Playbook
---
- hosts: databases
tasks:
- name: uptime
command: uptime
- name: uname
command: uname
JSON/YAML marker
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
47/122
Playbook
---
- hosts: databases
tasks:
- name: uptime
command: uptime
- name: uname
command: uname
Host group
(or: all)
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
48/122
Playbook
---
- hosts: databases
tasks:
- name: uptime
command: uptime
- name: uname
command: uname
Task list

Recommended for you

What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3

Pavan Deolasee gives an overview of new features in PostgreSQL 9.3. Key additions include support for auto updatable and materialized views, the LATERAL keyword for subqueries, range type enhancements, improved JSON support, foreign data wrappers allowing remote data access, parallel pg_dump for faster backups, event triggers for DDL monitoring, and streaming-only replication remastering. Many performance and management features are also introduced to make PostgreSQL more powerful and easier to administer.

postgresql
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...

Hong Kong Open Source Conference 2018 Containerized High Availability Virtual Hosting Deployment with Kubernetes, Docker and Ansible https://hkoscon.org/2018/topic/containerized-high-availability-virtual-hosting-deployment-kubernetes-docker-and-ansible/

ansibledockerkubernetes
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet

This document discusses puppetizing complex applications like sipXecs, an open source voice over IP telephony server. It provides an overview of Puppet and how it can be used to deploy and configure sipXecs in a repeatable, automated way. Challenges with the existing sipXecs installation and configuration are discussed. The document explores potential approaches like using test frameworks and APIs but concludes there is no perfect solution yet and engagement with upstream suppliers may be needed.

puppettestingsipx
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
49/122
Playbook
---
- hosts: databases
tasks:
- name: uptime
command: uptime
- name: uname
command: uname
Task 1
Task 2
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
50/122
Run the Playbook
ansible-playbook -i hosts.cfg playbook.yml
PLAY [all] **********************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
Ok: [192.168.0.5]
TASK [uptime] TASK [uname] ******************************************************************************************
changed: [192.168.0.5]
TASK [uname] ********************************************************************************************************
changed: [192.168.0.5]
PLAY RECAP **********************************************************************************************************
192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
51/122
Run the Playbook
ansible-playbook -i hosts.cfg playbook.yml
PLAY [all] **********************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
Ok: [192.168.0.5]
TASK [uptime] TASK [uname] ******************************************************************************************
changed: [192.168.0.5]
TASK [uname] ********************************************************************************************************
changed: [192.168.0.5]
PLAY RECAP **********************************************************************************************************
192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds
Run the Playbook
(using the “playbook” command
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
52/122
Run the Playbook
ansible-playbook -i hosts.cfg playbook.yml
PLAY [all] **********************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
Ok: [192.168.0.5]
TASK [uptime] TASK [uname] ******************************************************************************************
changed: [192.168.0.5]
TASK [uname] ********************************************************************************************************
changed: [192.168.0.5]
PLAY RECAP **********************************************************************************************************
192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds
Task changed something

Recommended for you

Ansible intro
Ansible introAnsible intro
Ansible intro

This document provides an overview of Ansible, an open source automation tool. It discusses Ansible's core components like playbooks, roles, variables and modules. It also covers how to use Ansible for tasks like configuration management, deployment, security and continuous delivery. Finally, it mentions ways to get started with Ansible including using command line tools, the galaxy module to share roles and vault to protect sensitive data.

ansibleautomation
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS

Moving to the cloud is hard, and moving Postgres databases to the cloud is even harder. Public cloud or private cloud? Infrastructure as a Service (IaaS), or Platform as a Service (PaaS)? Kubernetes for the application, or for the database and the application? This talk will juxtapose self-managed Kubernetes and container-based database solutions, Postgres deployments on IaaS, and Postgres DBaaS solutions of which EDB’s DBaaS BigAnimal is the latest example.

 
by EDB
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen

Dieses Webinar hilft Ihnen, die Unterschiede zwischen den verschiedenen Replikationsansätzen zu verstehen, die Anforderungen der jeweiligen Strategie zu erkennen und sich über die Möglichkeiten klar zu werden, was mit jeder einzelnen zu erreichen ist. Damit werden Sie hoffentlich eher in der Lage sein, herauszufinden, welche PostgreSQL-Replikationsarten Sie wirklich für Ihr System benötigen. - Wie physische und logische Replikation in PostgreSQL funktionieren - Unterschiede zwischen synchroner und asynchroner Replikation - Vorteile, Nachteile und Herausforderungen bei der Multi-Master-Replikation - Welche Replikationsstrategie für unterschiedliche Use-Cases besser geeignet ist Referent: Borys Neselovskyi, Regional Sales Engineer DACH, EDB ------------------------------------------------------------ For more #webinars, visit http://bit.ly/EDB-Webinars Download free #PostgreSQL whitepapers: http://bit.ly/EDB-Whitepapers Read our #Postgres Blog http://bit.ly/EDB-Blogs Follow us on Facebook at http://bit.ly/EDB-FB Follow us on Twitter at http://bit.ly/EDB-Twitter Follow us on LinkedIn at http://bit.ly/EDB-LinkedIn Reach us via email at marketing@enterprisedb.com

 
by EDB
postgresqledbreplication
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
53/122
Run the Playbook
ansible-playbook -i hosts.cfg playbook.yml
PLAY [all] **********************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
Ok: [192.168.0.5]
TASK [uptime] TASK [uname] ******************************************************************************************
changed: [192.168.0.5]
TASK [uname] ********************************************************************************************************
changed: [192.168.0.5]
PLAY RECAP **********************************************************************************************************
192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds
Summary
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
54/122
Playbook versus Ad-hoc
●
Ad-hoc is about simple commands
– Output is of interest
●
Playbooks are about idempotence
– Output is not really interesting
– Change is interesting, and so is a failure
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
55/122
Error handling
---
- hosts: all
any_errors_fatal: True
tasks:
- name: non-existent command
command: downtime
- name: uname
command: uname
Abort everything
on first error
Non-existent
command
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
56/122
Failing Playbook
ansible-playbook -i hosts.cfg playbook.yml
PLAY [all] ****************************************************************************************************************
TASK [non-existent command] ***********************************************************************************************
Fatal: [192.168.0.5]: FAILED! => {"changed": false, "cmd": "downtime", "msg": "[Errno 2] No such file or directory", "rc": 2}
NO MORE HOSTS LEFT ********************************************************************************************************
PLAY RECAP ****************************************************************************************************************
192.168.0.5 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds

Recommended for you

Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube

Cuando busca alternativas a Oracle en la nube, hacer el cambio puede parecer un trabajo duro. Entendemos que la migración involucra más que solo la base de datos. La compatibilidad es un punto clave, especialmente cuando se consideran los recursos que posiblemente ya haya invertido en Oracle, como por ejemplo el código de aplicación específico de Oracle.Este seminario web explorará las opciones y las principales consideraciones al pasar de las bases de datos de Oracle a la nube. - Revisión detallada de las ofertas de bases de datos disponibles en la nube - Factores críticos que se deben considerar considerar para elegir la oferta en la nube más adecuada - Cómo la experiencia de EDB con PostgreSQL puede ayudarlo en su decisión - Demostración de BigAnimal de EDB Présentateur: Sergio Romera, Senior Sales Engineer EMEA, EDB ------------------------------------------------------------ For more #webinars, visit http://bit.ly/EDB-Webinars Download free #PostgreSQL whitepapers: http://bit.ly/EDB-Whitepapers Read our #Postgres Blog http://bit.ly/EDB-Blogs Follow us on Facebook at http://bit.ly/EDB-FB Follow us on Twitter at http://bit.ly/EDB-Twitter Follow us on LinkedIn at http://bit.ly/EDB-LinkedIn Reach us via email at marketing@enterprisedb.com

 
by EDB
cloudpostgrespostgresql
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021

This document provides an overview and demonstration of EnterpriseDB's Failover Manager (EFM). It begins with an overview of EFM's capabilities in ensuring high availability and minimizing downtime during database upgrades or maintenance. It then covers installation and configuration prerequisites, supported platforms, and the EFM architecture involving a primary, standby, and witness database nodes. The remainder demonstrates switchover and failover functionality through a live demo in a replication environment using CentOS 7.7 and EnterpriseDB PostgreSQL Advanced Server 13.

 
by EDB
postgresqlfailover managerhigh availability
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL

Database come PostgreSQL non possono girare su Kubernetes. Questo è il ritornello che sentiamo continuamente, ma al tempo stesso la motivazione per noi di EDB di abbattere questo muro, una volta per tutte. In questo webinar parleremo della nostra avventura finora per portare PostgreSQL su Kubernetes. Scopri perché crediamo che fare benchmark di storage e del database prima di andare in produzione porti a una più sana e longeva vita di un DBMS, anche su Kubernetes. Condivideremo il nostro processo, i risultati fin qui ottenuti e sveleremo i nostri piani per il futuro con Cloud Native PostgreSQL.

 
by EDB
postgresqlcloudcloud database
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
58/122
“Demo”
●
The following slides will:
– Install a PostgreSQL database
– Check connectivity
– Create new roles + databases
– Allow access (modify pg_hba.conf)
– Create a table + index
– Run a query
 Managing PostgreSQL with Ansible
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
60/122
Debian (commandline)
apt-get install postgresql-13 postgresql-client-13
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libboost-serialization1.71.0 libgmpxx4ldbl libprotobuf-c1 libsfcgal1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
postgresql-client-common postgresql-common
Suggested packages:
postgresql-doc-13
The following NEW packages will be installed:
postgresql-13 postgresql-client-13 postgresql-client-common postgresql-common
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 14,5 MB/14,7 MB of archives.
After this operation, 45,6 MB of additional disk space will be used.

Recommended for you

Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL

Replicación física, replicación lógica, síncrona, asíncrona, multi-maestro, escalabilidad horizontal, etc. Son muchos los términos asociados con la replicación de bases de datos. En esta charla revisaremos los conceptos fundamentales detrás de cada variación de la replicación de PostgreSQL, y en qué casos conviene usar una o la otra. La presentación incluye una parte práctica con demostraciones aunque no será un tutorial sobre como configurar un cluster. El enfoque está en entender cada variación para elegir la mejor dependiendo del caso de uso. Cosas que aprenderán: - Cómo funciona la replicación física en PostgreSQL - Cómo funciona la replicación lógica en PostgreSQL - Diferencias entre replicación síncrona y asíncrona - Qué es replicación multi-maestro

 
by EDB
postgresqlreplicationdatabase
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL

PostgreSQL is an object-relational database system. NoSQL on the other hand is a non-relational database and is document-oriented. Learn how the PostgreSQL database gives one the flexible options to combine NoSQL workloads with the relational query power by offering JSON data types. With PostgreSQL, new capabilities can be developed and plugged into the database as required. Attend this webinar to learn: - The new features and capabilities in PostgreSQL for new workloads, requiring greater flexibility in the data model - NoSQL with JSON, Hstore and its performance and features for enterprises - Spatial SQL - advanced features in PostGIS application with PostGIS extension

 
by EDB
postgresqldatabasesrelational databases
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?

"Why use PgBouncer? It’s a lightweight, easy to configure connection pooler and it does one job well. As you’d expect from a talk on connection pooling, we’ll give a brief summary of connection pooling and why it increases efficiency. We’ll look at when not to use connection pooling, and we’ll demonstrate how to configure PgBouncer and how it works. But. Did you know you can also do this? 1. Scaling PgBouncer PgBouncer is single threaded which means a single instance of PgBouncer isn’t going to do you much good on a multi-threaded and/or multi-CPU machine. We’ll show you how to add more PgBouncer instances so you can use more than one thread for easy scaling. 2. Read-write / read only routing Using different pgBouncer databases you can route read-write traffic to the primary database and route read-only traffic to a number of standby databases. 3. Load balancing When we use multiple PgBouncer instances, load balancing comes for free. Load balancing can be directed to different standbys, and weighted according to ratios of load. 4. Silent failover You can perform silent failover during promotion of a new primary (assuming you have a VIP/DNS etc that always points to the primary). 5. And even: DoS prevention and protection from “badly behaved” applications! By using distinct port numbers you can provide database connections which deal with sudden bursts of incoming traffic in very different ways, which can help prevent the database from becoming swamped during high activity periods. You should leave the presentation wondering if there is anything PgBouncer can’t do."

 
by EDB
postgresqlpgbounceropen source
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
61/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
62/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
Ad-hoc
command
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
63/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
Ad-hoc
command
Execute
as “root”
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
64/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
Ad-hoc
command
Execute
as “root”
“apt”
module

Recommended for you

Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL

In this talk I'll discuss how we can combine the power of PostgreSQL with TensorFlow to perform data analysis. By using the pl/python3 procedural language we can integrate machine learning libraries such as TensorFlow with PostgreSQL, opening the door for powerful data analytics combining SQL with AI. Typical use-cases might involve regression analysis to find relationships in an existing dataset and to predict results based on new inputs, or to analyse time series data and extrapolate future data taking into account general trends and seasonal variability whilst ignoring noise. Python is an ideal language for building custom systems to do this kind of work as it gives us access to a rich ecosystem of libraries such as Pandas and Numpy, in addition to TensorFlow itself.

 
by EDB
postgresqldata analyticstensorflow
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres

Has your table become too large to handle? Have you thought about chopping it up into smaller pieces that are easier to query and maintain? What if it's in constant use? An introduction to the problems that can arise and how PostgreSQL's partitioning features can help, followed by a real-world scenario of partitioning an existing huge table on a live system. We will be looking at the problems caused by having very large tables in your database and how declarative table partitioning in Postgres can help. Also, how to perform dimensioning before but also after creating huge tables, partitioning key selection, the importance of upgrading to get the latest Postgres features and finally we will dive into a real-world scenario of having to partition an existing huge table in use on a production system.

 
by EDB
postgresqlpartitioningpostgres
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN

There have been plenty of “explaining EXPLAIN” type talks over the years, which provide a great introduction to it. They often also cover how to identify a few of the more common issues through it. EXPLAIN is a deep topic though, and to do a good introduction talk, you have to skip over a lot of the tricky bits. As such, this talk will not be a good introduction to EXPLAIN, but instead a deeper dive into some of the things most don’t cover. The idea is to start with some of the more complex and unintuitive calculations needed to work out the relationships between operations, rows, threads, loops, timings, buffers, CTEs and subplans. Most popular tools handle at least several of these well, but there are cases where they don’t that are worth being conscious of and alert to. For example, we’ll have a look at whether certain numbers are averaged per-loop or per-thread, or both. We’ll also cover a resulting rounding issue or two to be on the lookout for. Finally, some per-operation timing quirks are worth looking out for where CTEs and subqueries are concerned, for example CTEs that are referenced more than once. As time allows, we can also look at a few rarer issues that can be spotted via EXPLAIN, as well as a few more gotchas that we’ve picked up along the way. This includes things like spotting when the query is JIT, planning, or trigger time dominated, spotting the signs of table and index bloat, issues like lossy bitmap scans or index-only scans fetching from the heap, as well as some things to be aware of when using auto_explain.

 
by EDB
postgresqlpostgresopen source
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
65/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
66/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
List of
packages
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
67/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
List of
packages
Desired
Package
state
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
68/122
Debian (Ansible Ad-hoc)
ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
127.0.0.1 | CHANGED => {
"ansible_facts": {
...
},
"cache_update_time": 1592052301,
"cache_updated": false,
"changed": true,
"stderr": "",
"stderr_lines": [],
"stdout": "…”
"stdout_lines": […]
]
}
Something
changed
Watch for
errors

Recommended for you

IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL

This document provides an overview of using PostgreSQL for IoT applications. Chris Ellis discusses why PostgreSQL is a good fit for IoT due to its flexibility and extensibility. He describes various ways of storing, loading, and processing IoT time series and sensor data in PostgreSQL, including partitioning, batch loading, and window functions. The document also briefly mentions the TimescaleDB extension for additional time series functionality.

 
by EDB
postgresqldatabaseiot
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL

The document describes a migration from an Oracle database topology to a PostgreSQL database topology at ACI. It discusses the starting Oracle topology with issues around operational complexity and non-ACID compliance. It then describes the target PostgreSQL topology with improved performance, availability and lower costs. The document outlines decisions around tools, extensions, code changes and testing approaches needed for the migration. It also discusses options for migrating the data and cutting over to the new PostgreSQL environment.

 
by EDB
postgresqloracleoracle migration
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!

The document provides an introduction to using the psql command line tool for interacting with PostgreSQL databases. It explains how to connect to a database, perform basic queries, explain query plans, and get information about tables, schemas, and users.

 
by EDB
postgrespostgresqlopensource
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
69/122
Install PostgreSQL with a Playbook
- hosts: all
any_errors_fatal: True
become: yes
tasks:
- name: Install PostgreSQL
apt:
name:
- postgresql-13
- postgresql-client-13
- python3-psycopg2
state: present
Run as “root”
Use Debian
package module “apt”
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
70/122
Install PostgreSQL with a Playbook
ansible-playbook -i 192.168.0.5, playbook.yml
TASK [Install PostgreSQL]
***************************************************************
Changed: [192.168.0.5]
PLAY RECAP ****************************************************
192.168.0.5 : ok=2 changed=1 unreachable=0 failed=0
Playbook run took 0 days, 0 hours, 0 minutes, 24 seconds
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
71/122
Re-run the Playbook
ansible-playbook -i 192.168.0.5, playbook.yml
TASK [Install PostgreSQL]
***************************************************************
Changed: [192.168.0.5]
PLAY RECAP ****************************************************
192.168.0.5 : ok=2 changed=0 unreachable=0 failed=0
Playbook run took 0 days, 0 hours, 0 minutes, 24 seconds
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
72/122
State
●
Many Ansible modules have a “state” parameter
– Usually defaults to “present”
– “present” will install a package, but not upgrade it
– “latest” will upgrade, if newer package is available
– “absent” will uninstall a package

Recommended for you

EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ

Database security is always of paramount importance to all organizations. In this webinar, we will explore the security, usability, and portability updates of the latest version of the EDB database server and tools. Join us in this webinar to learn: - The new security features such as SCRAM and the encryption of database passwords and traffic between Failover Manager agents - Usability updates that automate partitioning, verify backup integrity, and streamline the management of failover and backups - Portability improvements that simplify running PostgreSQL across on-premise and cloud environments

 
by EDB
postgresqldatabaseopen source
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données

Dans ce webinar, nous allons parler des différences entre une sauvegarde physique et une sauvegarde logique. Nous allons lister les avantages et inconvénients, les principales considérations et les outils disponibles pour les deux méthodes. - Perte de données - Exports logiques - Standbys - WALs et Recovery - Snapshots VM/Disques - Sauvegardes physique - Conclusion

 
by EDB
postgresqlopen sourcedatabase
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano

Vieni a scoprire Cloud Native PostgreSQL (CNP), l’operatore per Kubernetes, direttamente da coloro che lo hanno ideato e lo sviluppano in EDB. CNP facilita l’integrazione di database PostgreSQL con le tue applicazioni all’interno di cluster Kubernetes e OpenShift Container Platform di RedHat, grazie alla sua gestione automatica dell’architettura primario/standby che include: self-healing, failover, switchover, rolling update, backup, ecc. Durante il webinar affronteremo i seguenti punti: - DevOps e Cloud Native - Introduzione a Cloud Native PostgreSQL - Architetture - Caratteristiche principali - Esempi di uso e configurazione - Kubernetes, Storage e Postgres - Demo - Conclusioni

 
by EDB
postgresqlkubernetescloud
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
74/122
Next: check if PostgreSQL is running
●
Ansible provides the “postgresql_ping” module
– Login credentials are required (db, username, host)
●
This is useful at the beginning of the Playbook:
– See if the DB is up and running
– Otherwise later commands fail with more obscure errors
●
This module runs on the remote host
– Hence: the db is on “127.0.0.1”
– The Unix Domain Socket is used
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
75/122
Check if PostgreSQL is running
- name: Ping PostgreSQL
postgresql_ping:
db: postgres
login_unix_socket: "/var/run/postgresql"
login_user: postgres
become: yes
become_user: postgres
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
76/122
Check if PostgreSQL is running
- name: Ping PostgreSQL
postgresql_ping:
db: postgres
login_unix_socket: "/var/run/postgresql"
login_user: postgres
become: yes
become_user: postgres
Runs on
“local host”
Ansible runs this
as user “postgres”

Recommended for you

New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13

EDB 13 enhances our flagship database server and tools. This webinar will explore its security, usability, and portability updates. Join us to learn how EDB 13 can help you improve your PostgreSQL productivity and data protection. Webinar highlights include: - New security features such as SCRAM and the encryption of database passwords and traffic between Failover Manager agents - Usability updates that automate partitioning, verify backup integrity and streamline the management of failover and backups - Portability improvements that simplify running PostgreSQL across on-premise and cloud environments

 
by EDB
postgresqlopen source databasedatabase
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL

The webinar will review a multi-layered framework for PostgreSQL security, with a deeper focus on limiting access to the database and data, as well as securing the data. Using the popular AAA (Authentication, Authorization, Auditing) framework we will cover: - Best practices for authentication (trust, certificate, MD5, Scram, etc). - Advanced approaches, such as password profiles. - Deep dive of authorization and data access control for roles, database objects (tables, etc), view usage, row-level security, and data redaction. - Auditing, encryption, and SQL injection attack prevention. Note: this session is delivered in German Speaker: Borys Neselovskyi, Sales Engineer, EDB

 
by EDB
securitydatabasepostgresql
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ

EDB Cloud Native Postgres includes database container images and a Kubernetes Operator that manage the lifecycle of a database from deployment to operations. This Kubernetes Operator for Postgres is written by EDB entirely from scratch in the Go language and relies exclusively on the Kubernetes API. Attend this webinar to learn about: - DevOps & Cloud Native - Overview of Cloud Native Postgres - Storage for Postgres workloads in Kubernetes - Using Cloud Native Postgres - Demo

 
by EDB
postgresqldatabaseopen source
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
77/122
Check if PostgreSQL is running
TASK [Ping PostgreSQL] *******************************************
Ok: [192.168.0.5]
PLAY RECAP *******************************************************
192.168.0.5 : ok=1 changed=0 unreachable=0
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
79/122
Create Roles + Databases
●
Manage roles: postgresql_user
●
Manage databases: postgresql_db
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
80/122
Adding a new role
- name: Create role
postgresql_user:
db: postgres
login_user: postgres
login_unix_socket: "/var/run/postgresql"
Name: "{{ demouser }}"
Password: "{{ demopass }}"
become: yes
become_user: postgres

Recommended for you

論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...

Jindong Gu, Zhen Han, Shuo Chen, Ahmad Beirami, Bailan He, Gengyuan Zhang, Ruotong Liao, Yao Qin, Volker Tresp, Philip Torr "A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models" arXiv2023 https://arxiv.org/abs/2307.12980

Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure

Recent advancements in the NIST-JARVIS infrastructure: JARVIS-Overview, JARVIS-DFT, AtomGPT, ALIGNN, JARVIS-Leaderboard

jarvisjarvis-dftalignn
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf

These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.

air force fighter planebiggest submarinezambia port
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
81/122
Adding a new role
- name: Create role
postgresql_user:
db: postgres
login_user: postgres
login_unix_socket: "/var/run/postgresql"
Name: "{{ demouser }}"
Password: "{{ demopass }}"
become: yes
become_user: postgres
Username and password
are stored in variables
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
82/122
Notes on creating roles
●
The password is stored in a variable
– Transmitted in clear text to the remote host
– Ansible will prevent logging the password
●
Consider pre-encrypted passwords
– Creating them is not part of this talk
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
83/122
Example: remove a role
- name: Drop role
postgresql_user:
db: postgres
login_user: postgres
login_unix_socket: "/var/run/postgresql"
name: "otheruser"
state: absent
become: yes
become_user: postgres
State: “absent” to
remove the role
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
84/122
Adding a new database
- name: Create database
postgresql_db:
maintenance_db: postgres
login_user: postgres
login_unix_socket: "/var/run/postgresql"
name: "{{ demodb }}"
owner: "{{ demouser }}"
become: yes
become_user: postgres
Database name is
stored in a variable

Recommended for you

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf

In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.

social media hackerfacebook hackerhire a instagram hacker
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx

How do we build an IoT product, and make it profitable? Talk from the IoT meetup in March 2024. https://www.meetup.com/iot-sweden/events/299487375/

iot
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
85/122
Adding a new database
- name: Create database
postgresql_db:
maintenance_db: postgres
login_user: postgres
login_unix_socket: "/var/run/postgresql"
name: "{{ demodb }}"
owner: "{{ demouser }}"
become: yes
become_user: postgres
New db owner
(optional)
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
86/122
Notes on databases
●
“state=dump” allows taking backups
●
“state=restore” allows restoring backups
●
Needs a “target=<filename>” for backup/restore
 Managing PostgreSQL with Ansible
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
88/122
Modify pg_hba.conf
- name: Allow access for demo user from everywhere
postgresql_pg_hba:
dest: "/etc/postgresql/13/main/pg_hba.conf"
contype: host
users: "demouser"
source: "0/0"
databases: "demodb"
method: "md5"
notify:
- reload postgresql

Recommended for you

Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant

Password Rotation in 2024 is still Relevant

passwordmanagementrotation
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf

Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.

infrastructure as codeclouddevops
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf

Solar Storms (Geo Magnetic Storms) are the motion of accelerated charged particles in the solar environment with high velocities due to the coronal mass ejection (CME).

solar storms
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
89/122
Notes on modifying pg_hba.conf
●
The “postgresql_pg_hba” module does not allow much control
over the sort order of the entries
– Consider “lineinfile” or “blockinfile” or “template” modules
●
It must be run as root (on Debian)
– The configfiles live in /etc/postgresql
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
90/122
Modify pg_hba.conf
- name: Allow access for demo user from everywhere
postgresql_pg_hba:
dest: "/etc/postgresql/13/main/pg_hba.conf"
contype: host
Users: "{{ demouser }}"
source: "0/0"
Databases: "{{ demodb }}"
method: "md5"
notify:
- reload postgresql Introduces a “notify”,
which requires a “handler”
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
91/122
Handler
- hosts: all
tasks:
handlers:
- name: reload postgresql
service:
name: postgresql
state: reloaded
“handlers” are defined
like “tasks”
The “name” is free-form
Any Ansible module
can be used here
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
92/122
Handler
●
Handler can be called from many places
●
Run when the Playbook ends
– All “notify”s are queued
●
Ideal to reload/restart services at the end
– The notify is only run when the Task changed
– Playbook doesn’t have to check every single Task

Recommended for you

20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024

Everything that I found interesting last month about the irresponsible use of machine intelligence

quantumfaxmachine
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference

We are honored to launch and host this event for our UiPath Polish Community, with the help of our partners - Proservartner! We certainly hope we have managed to spike your interest in the subjects to be presented and the incredible networking opportunities at hand, too! Check out our proposed agenda below 👇👇 08:30 ☕ Welcome coffee (30') 09:00 Opening note/ Intro to UiPath Community (10') Cristina Vidu, Global Manager, Marketing Community @UiPath Dawid Kot, Digital Transformation Lead @Proservartner 09:10 Cloud migration - Proservartner & DOVISTA case study (30') Marcin Drozdowski, Automation CoE Manager @DOVISTA Pawel Kamiński, RPA developer @DOVISTA Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner 09:40 From bottlenecks to breakthroughs: Citizen Development in action (25') Pawel Poplawski, Director, Improvement and Automation @McCormick & Company Michał Cieślak, Senior Manager, Automation Programs @McCormick & Company 10:05 Next-level bots: API integration in UiPath Studio (30') Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner 10:35 ☕ Coffee Break (15') 10:50 Document Understanding with my RPA Companion (45') Ewa Gruszka, Enterprise Sales Specialist, AI & ML @UiPath 11:35 Power up your Robots: GenAI and GPT in REFramework (45') Krzysztof Karaszewski, Global RPA Product Manager 12:20 🍕 Lunch Break (1hr) 13:20 From Concept to Quality: UiPath Test Suite for AI-powered Knowledge Bots (30') Kamil Miśko, UiPath MVP, Senior RPA Developer @Zurich Insurance 13:50 Communications Mining - focus on AI capabilities (30') Thomasz Wierzbicki, Business Analyst @Office Samurai 14:20 Polish MVP panel: Insights on MVP award achievements and career profiling

#uipathcommunity#automation#automationdeveloper
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf

Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment. How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.

pigging solutionsprocess piggingproduct transfers
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
93/122
pg_hba.conf
cat /etc/postgresql/13/main/pg_hba.conf
…
host demodb demouser 0/0 md5
…
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
95/122
Creates tables + indexes
●
postgresql_table: manage tables
●
postgresql_idx: manage indexes
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
96/122
Create a table
- name: Create table
postgresql_table:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
name: "demotable"
columns:
- id serial primary key
- data text
owner: "demouser"
become: yes
become_user: postgres

Recommended for you

20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024

Everything that I found interesting about engineering leadership last month

quantumfaxmachine
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition

The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.

Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers

The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era. Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.

programmingcodingcivil engineering
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
97/122
Create a table
- name: Create table
postgresql_table:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
name: "demotable"
columns:
- id serial primary key
- data text
owner: "demouser"
become: yes
become_user: postgres
Table name and
definition
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
98/122
Notes on tables
●
Will not add/remove new columns
– Only the initial set of columns is used when creating the
table
●
Can specify table and storage parameters
●
Can create tables “like” another table
●
Can drop/truncate/rename tables
●
Can create unlogged tables
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
99/122
Create an index
- name: Create index on demo table
postgresql_idx:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
columns: "data"
idxname: "demotable_data_ixd"
table: "demotable"
become: yes
become_user: postgres
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
100/122
Create an index
- name: Create index on demo table
postgresql_idx:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
table: "demotable"
columns: "data"
idxname: "demotable_data_ixd"
become: yes
become_user: postgres
Index column(s)

Recommended for you

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL

Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.

blockchainweb3blockchain technology
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence

Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently. Visit- https://onliveserver.com/linux-web-hosting/

cheap linux hosting
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
101/122
Create an index
- name: Create index on demo table
postgresql_idx:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
table: "demotable"
columns: "data"
idxname: "demotable_data_ixd"
become: yes
become_user: postgres
Index name
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
102/122
Notes on Indexes
●
The index name is always required (sigh)
●
Index can cover multiple columns
●
Index can have a different type (“idxtype”)
●
Index can be on another tablespace (“tablespace”)
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
103/122
Show table
demodb=# d demotable
Table "public.demotable"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------------------------------------
id | integer | | not null | nextval('demotable_id_seq'::regclass)
data | text | | |
Indexes:
"demotable_pkey" PRIMARY KEY, btree (id)
"demotable_data_ixd" btree (data)
 Managing PostgreSQL with Ansible

Recommended for you

How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx

Revolutionize your transportation processes with our cutting-edge RPA software. Automate repetitive tasks, reduce costs, and enhance efficiency in the logistics sector with our advanced solutions.

rpa in transportationrpa in transportation industryrpa in transportation sector
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry

Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data. The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs. Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution! Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.

cloudcloud native observabilitycloud native
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
105/122
Run queries
●
postgresql_query: run a query against the database
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
106/122
Run queries
- name: Run INSERT
postgresql_query:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
query: "INSERT INTO demotable (data) VALUES ((SELECT random()::TEXT))"
become: yes
become_user: postgres
Query to run
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
107/122
Notes on Queries
●
Each call of “postgresql_query” will “change” the database
– Even if it’s a SELECT query
– Use “changed_when: False”
– Not idempotent by default
●
Queries in Ansible can run in a long-running transaction
– Don’t forget to commit/rollback
●
Positional arguments and placeholders (prepared queries) are possible
●
SQL Code can be in a script
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
108/122
Run a SELECT query
- name: Run SELECT
postgresql_query:
login_user: postgres
login_unix_socket: "/var/run/postgresql"
db: "demodb"
query: "SELECT COUNT(*) AS count FROM demotable"
become: yes
become_user: postgres
register: select_result
Store the entire
result in a
variable

Recommended for you

Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
109/122
Show the result
- name:
debug:
msg: "{{ select_result.query_result[0].count }}"
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
110/122
Show the result
- name:
debug:
msg: "{{ select_result.query_result[0].count }}"
Result
variable
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
111/122
Show the result
- name:
debug:
msg: "{{ select_result.query_result[0].count }}"
Result
variable
Query
results
Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
112/122
Show the result
- name:
debug:
msg: "{{ select_result.query_result[0].count }}"
Result
variable
Query
results
The “count”
from the query

Recommended for you

Postgres Vision 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
113/122
Query result
TASK [debug] ************************************
ok: [127.0.0.1] => {
"msg": "8"
}
count(*)
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
115/122
Running Playbooks
●
Playbooks can run from any (Linux) computer
– Every developer can run them
– However: every developer needs access to all credentials
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
116/122
Ansible Tower
●
Ansible Tower provides a central place to run Playbooks
– Runs can be triggered (as example: GitHub commits)
– Runs can be scheduled
– Nice web interface
●
Commercial product by Red Hat

Recommended for you

Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
117/122
Image copyright: Red Hat
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
118/122
Ansible Tower in Open Source: AWX
●
More frequent releases
– basically: development version for Ansible Tower
●
No support from Red Hat
●
No cross-upgrade possible
 Managing PostgreSQL with Ansible
Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
120/122
Ansible
●
Useful tool to manage a large fleet of servers, VMs, services
and applications
●
Self-documentation
●
Idempotence allows re-running of Playbooks until success

Recommended for you

Postgres Build 2020 Managing PostgreSQL with Ansible
Andreas Scherbaum
121/122
Ansible & PostgreSQL
●
Many useful modules to manage (almost) any aspect of
PostgreSQL databases
●
Quick results & small overhead, compared to “shell scripts”
 Managing PostgreSQL with Ansible

More Related Content

What's hot

MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
NeoClova
 
Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)
Anastasia Lubennikova
 
Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogical
Umair Shahid
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
Yashar Esmaildokht
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
Open Source Consulting
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識
Ken SASAKI
 
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
Brian Hong
 
Linux Performance Analysis and Tools
Linux Performance Analysis and ToolsLinux Performance Analysis and Tools
Linux Performance Analysis and Tools
Brendan Gregg
 
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
Chika SATO
 
Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Aurora Deep Dive (db tech showcase 2016)Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Web Services Japan
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
NTT DATA Technology & Innovation
 
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
NTT DATA Technology & Innovation
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
NeoClova
 
NetApp XCP データ移行ツールインストールと設定
NetApp XCP データ移行ツールインストールと設定NetApp XCP データ移行ツールインストールと設定
NetApp XCP データ移行ツールインストールと設定
Kan Itani
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
Codership Oy - Creators of Galera Cluster
 
MongoDB Database Replication
MongoDB Database ReplicationMongoDB Database Replication
MongoDB Database Replication
Mehdi Valikhani
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
Command Prompt., Inc
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
René Cannaò
 
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
Hironobu Suzuki
 

What's hot (20)

MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)
 
Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogical
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識
 
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
AWS와 함께 한 쿠키런 서버 Re-architecting 사례 (Gaming on AWS)
 
Linux Performance Analysis and Tools
Linux Performance Analysis and ToolsLinux Performance Analysis and Tools
Linux Performance Analysis and Tools
 
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
バックアップことはじめ JPUG第29回しくみ+アプリケーション分科会(2014-05-31)
 
Hive on Tezのベストプラクティス
Hive on TezのベストプラクティスHive on Tezのベストプラクティス
Hive on Tezのベストプラクティス
 
Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Aurora Deep Dive (db tech showcase 2016)Amazon Aurora Deep Dive (db tech showcase 2016)
Amazon Aurora Deep Dive (db tech showcase 2016)
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版���(第34回PostgreSQLアンカンファレンス...
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
NetApp XCP データ移行ツールインストールと設定
NetApp XCP データ移行ツールインストールと設定NetApp XCP データ移行ツールインストールと設定
NetApp XCP データ移行ツールインストールと設定
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
MongoDB Database Replication
MongoDB Database ReplicationMongoDB Database Replication
MongoDB Database Replication
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
 

Similar to Managing PostgreSQL with Ansible

The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
PostgreSQL Experts, Inc.
 
Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014
vespian_256
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach
PROIDEA
 
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainly
vespian_256
 
Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL Extensions
EDB
 
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Gulcin Yildirim Jelinek
 
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes][BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
Wong Hoi Sing Edison
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
NETWAYS
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
Puppet
 
Postgres Deployment Automation with Terraform and Ansible
 Postgres Deployment Automation with Terraform and Ansible Postgres Deployment Automation with Terraform and Ansible
Postgres Deployment Automation with Terraform and Ansible
EDB
 
Managing Postgres with Ansible
Managing Postgres with AnsibleManaging Postgres with Ansible
Managing Postgres with Ansible
Gulcin Yildirim Jelinek
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
Cédric Delgehier
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
GR8Conf
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
FITC
 
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our Wishbone
Mydbops
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
M Malai
 
What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3
Pavan Deolasee
 
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
Wong Hoi Sing Edison
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
Kris Buytaert
 
Ansible intro
Ansible introAnsible intro

Similar to Managing PostgreSQL with Ansible (20)

The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014Automation@Brainly - Polish Linux Autumn 2014
Automation@Brainly - Polish Linux Autumn 2014
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach
 
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainly
 
Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL Extensions
 
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
 
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes][BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
Postgres Deployment Automation with Terraform and Ansible
 Postgres Deployment Automation with Terraform and Ansible Postgres Deployment Automation with Terraform and Ansible
Postgres Deployment Automation with Terraform and Ansible
 
Managing Postgres with Ansible
Managing Postgres with AnsibleManaging Postgres with Ansible
Managing Postgres with Ansible
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our Wishbone
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3
 
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 

More from EDB

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
EDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
EDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
EDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
EDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
EDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
EDB
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
EDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
EDB
 

More from EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
 

Recently uploaded

論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 

Recently uploaded (20)

論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 

Managing PostgreSQL with Ansible

  • 2. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 2/122 Agenda ● What is PostgreSQL ● What is Ansible ● Ansible Ad-hoc ● Ansible Playbooks ● Bring it all together ● Run it automated ● Summary
  • 3. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 3/122 Andreas Scherbaum ● Working with databases since 1997, with PostgreSQL since 1998 ● Founding member of the European and German PostgreSQL User Group ● Board of Directors – European PostgreSQL User Group ● Organizing pgconf.eu, pgconf.de, FOSDEM PGDay ● Regional Contact PostgreSQL for Germany ● Ran my own company for 7+ years – around PostgreSQL ● Wrote a book about PostgreSQL (in German) ● Worked for EMC/Pivotal from 2011 – August 2020 ● Joined Adjust in September 2020
  • 4. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 4/122 Get Social ... ● Twitter, Instagram & Tumblr: @ascherbaum ● LinkedIn: https://www.linkedin.com/in/andreas-scherbaum-87b6663/ ● Mastadon: https://mastodon.social/@ascherbaum ● Diaspora: ads@pluspora.com ● Blog: https://andreas.scherbaum.la/
  • 6. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 6/122 Source: unknown
  • 8. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 8/122 Ansible ● Ansible is: – Fictional device for superluminal communication ● Can send and receive messages without delay, over any distance ● From the 1966 novel “Rocannon’s World” by Ursula le Guin ● Later adapted by other science fiction, most notably: “Ender’s Game”
  • 9. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 9/122 Ansible ● Ansible is: – Open Source software for provisioning, configuration management, and application deployment – Manages many systems in parallel, by executing tasks over [ssh|Windows Remote Management|PowerShell] – Manages Unix-like and Microsoft Windows systems ● Ansible host has to be Unix/Linux – Under development since 2012, acquired by Red Hat in 2015 ● Current stable version: 2.10.x – Python knowledge useful, but not required
  • 10. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 10/122 Ansible Advantages ● Code = Documentation – If done properly ● Playbooks are idempotent – Can be re-run any time, only change what’s necessary ● Can deploy and manage large clusters of machines in parallel ● Playbooks can be run from multiple locations – As long as access is handled – No host agent necessary ● Extensive and powerful variable and template handling ● Requirements: Python (v3) – Some Ansible modules require additional Python modules
  • 11. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 11/122 Ansible Ansible Controller Host 1 Webserver Host 2 Webserver Host 3 Database Host 4 Load Balancer ssh
  • 12. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 12/122 Ansible Modules ● Database: PostgreSQL, MongoDB, MS SQL, MySQL, InfluxDB, … ● Files: fetch, copy, template, find, file, acl, archive, patch, archive, xml, xattr, … ● Network: AWS, GPC, [Switches], [Firewalls], [Loadbalancers] ● Storage, Notification, Crypto, Cloud, Source Control, ... ● Expandable!
  • 13. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 13/122 Ansible Ansible Controller Host 1 Webserver Host 2 Webserver Host 3 PostgreSQL Host 4 Load Balancer ssh
  • 14. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 14/122 Ansible PostgreSQL Modules (as of v2.10) ● Manage: databases, roles (user), membership, owner, schema, extensions, languages, privileges, publications, sequences, tables, indexes, replication slots ● Information: retrieve information about PG servers, ping servers ● pg_hba: manage access control ● Query: run queries against the database, or COPY data ● Many of the useful modules are available starting with version 2.8
  • 16. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 16/122 Ad-hoc queries ● Ansible allows to run ad-hoc commands against any given host or host group – Example: ping (check if host is alive, and Ansible can login)
  • 17. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 17/122 ping ansible -i 127.0.0.1, -m ping all
  • 18. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 18/122 ping ansible -i 127.0.0.1, -m ping all Inventory
  • 19. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 19/122 ping ansible -i 127.0.0.1, -m ping all Inventory Hostlist (as Python list, with comma)
  • 20. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 20/122 ping ansible -i 127.0.0.1, -m ping all
  • 21. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 21/122 ping ansible -i 127.0.0.1, -m ping all Module
  • 22. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 22/122 ping ansible -i 127.0.0.1, -m ping all Module Module Name
  • 23. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 23/122 ping ansible -i 127.0.0.1, -m ping all Module Module Name Servers (all)
  • 24. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 24/122 ping - pong ansible -i 127.0.0.1, -m ping all 127.0.0.1 | SUCCESS => { "ansible_facts": { ... }, "changed": false, "ping": "pong" }
  • 25. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 25/122 Password-less login ● Ansible needs to be able to login without password – For the regular user – And the root method (sudo, su), if necessary
  • 26. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 26/122 Module parameters ansible -i 127.0.0.1, -m command -a “uptime” all Additional Module Parameters
  • 27. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 27/122 Module output ansible -i 127.0.0.1, -m command -a “uptime” all 127.0.0.1 | CHANGED | rc=0 >> 23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27
  • 28. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 28/122 Module output ansible -i 127.0.0.1, -m command -a “uptime” all 127.0.0.1 | CHANGED | rc=0 >> 23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27 Command Output
  • 29. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 29/122 Module Return Code ansible -i 127.0.0.1, -m command -a “uptime” all 127.0.0.1 | CHANGED | rc=0 >> 23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27 Command Return Code
  • 30. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 30/122 Module output ansible -i 127.0.0.1, -m command -a “uptime” all 127.0.0.1 | CHANGED | rc=0 >> 23:04:34 up 5 days, 5:14, 16 users, load average: 1,82, 1,33, 1,27 “Something” changed
  • 31. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 31/122 Command output ● Ansible fetches STDOUT and STDERR from the remote host ● Shows both to the user, in Ad-hoc mode
  • 32. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 32/122 Command Result ● Ansible provides the command return code (RC) ● Playbooks can act on the RC – ignore_errors: true – failed_when: <condition>
  • 33. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 33/122 Changes ● Every time Ansible changes something on the host, the status of the task becomes “changed” – Can be ignored with “changed_when: false”
  • 34. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 34/122 “command” versus “shell” ● Ansible has 2 modules for executing arbitrary commands on the host: ● command: no variable replacement is done, no filehandle redirects (like: 2> /dev/null) are possible, only one command possible – uses “exec” ● shell: uses a regular shell to execute the command, can handle all kind of variables, or multiple shell commands – uses “system” – cat /etc/passwd | grep root | cut -f3 -d: ● Both modules (by default) “change” the remote system – Ansible doesn’t know what the module is executing
  • 35. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 35/122 “command” / “shell” versus modules ● Always aim to use Ansible modules over of “shell”/”command” ● Modules provide idempotence: – Multiple calls to the same module will not change the remote system
  • 37. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 37/122 Playbooks ● A Playbook is a text file (Yaml format) with tasks – Can run repeatedly - idempotent ● Playbooks can become very large, and complex – Split them up into roles (not topic of this talk) ● Playbooks can run on parts of the infrastructure – Example: only database hosts
  • 38. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 38/122 Hosts list ● The file “hosts.cfg” in the Playbook directory defines the hosts ● Variables can be specified – Per host – Per host group – … – Global
  • 39. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 39/122 hosts.cfg (Example) [all-systems:children] webservers databases [all-systems:vars] ssh_args = -o ServerAliveInterval=30 [databases] 192.168.0.5 hostname=db1 [databases:vars] db_type=postgresql
  • 40. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 40/122 hosts.cfg [all-systems:children] webservers databases [all-systems:vars] ssh_args = -o ServerAliveInterval=30 [databases] 192.168.0.5 hostname=db1 [databases:vars] db_type=postgresql Specify groups
  • 41. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 41/122 hosts.cfg [all-systems:children] webservers databases [all-systems:vars] ssh_args = -o ServerAliveInterval=30 [databases] 192.168.0.5 hostname=db1 [databases:vars] db_type=postgresql Variables for all child groups
  • 42. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 42/122 hosts.cfg [all-systems:children] webservers databases [all-systems:vars] ssh_args = -o ServerAliveInterval=30 [databases] 192.168.0.5 hostname=db1 [databases:vars] db_type=postgresql Database group with one host
  • 43. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 43/122 hosts.cfg [all-systems:children] webservers databases [all-systems:vars] ssh_args = -o ServerAliveInterval=30 [databases] 192.168.0.5 hostname=db1 [databases:vars] db_type=postgresql Variables for database group
  • 44. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 44/122 Playbook ● Specifies task groups (Plays) ● Goal is to group hosts together, and run Plays on them ● Ansible wants Playbooks to be idempotent: – Run many times, only change what is necessary – Ansible modules are idempotent – shell/command is not
  • 45. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 45/122 Playbook --- - hosts: databases tasks: - name: uptime command: uptime - name: uname command: uname
  • 46. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 46/122 Playbook --- - hosts: databases tasks: - name: uptime command: uptime - name: uname command: uname JSON/YAML marker
  • 47. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 47/122 Playbook --- - hosts: databases tasks: - name: uptime command: uptime - name: uname command: uname Host group (or: all)
  • 48. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 48/122 Playbook --- - hosts: databases tasks: - name: uptime command: uptime - name: uname command: uname Task list
  • 49. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 49/122 Playbook --- - hosts: databases tasks: - name: uptime command: uptime - name: uname command: uname Task 1 Task 2
  • 50. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 50/122 Run the Playbook ansible-playbook -i hosts.cfg playbook.yml PLAY [all] ********************************************************************************************************** TASK [Gathering Facts] ********************************************************************************************** Ok: [192.168.0.5] TASK [uptime] TASK [uname] ****************************************************************************************** changed: [192.168.0.5] TASK [uname] ******************************************************************************************************** changed: [192.168.0.5] PLAY RECAP ********************************************************************************************************** 192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds
  • 51. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 51/122 Run the Playbook ansible-playbook -i hosts.cfg playbook.yml PLAY [all] ********************************************************************************************************** TASK [Gathering Facts] ********************************************************************************************** Ok: [192.168.0.5] TASK [uptime] TASK [uname] ****************************************************************************************** changed: [192.168.0.5] TASK [uname] ******************************************************************************************************** changed: [192.168.0.5] PLAY RECAP ********************************************************************************************************** 192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds Run the Playbook (using the “playbook” command
  • 52. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 52/122 Run the Playbook ansible-playbook -i hosts.cfg playbook.yml PLAY [all] ********************************************************************************************************** TASK [Gathering Facts] ********************************************************************************************** Ok: [192.168.0.5] TASK [uptime] TASK [uname] ****************************************************************************************** changed: [192.168.0.5] TASK [uname] ******************************************************************************************************** changed: [192.168.0.5] PLAY RECAP ********************************************************************************************************** 192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds Task changed something
  • 53. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 53/122 Run the Playbook ansible-playbook -i hosts.cfg playbook.yml PLAY [all] ********************************************************************************************************** TASK [Gathering Facts] ********************************************************************************************** Ok: [192.168.0.5] TASK [uptime] TASK [uname] ****************************************************************************************** changed: [192.168.0.5] TASK [uname] ******************************************************************************************************** changed: [192.168.0.5] PLAY RECAP ********************************************************************************************************** 192.168.0.5 : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds Summary
  • 54. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 54/122 Playbook versus Ad-hoc ● Ad-hoc is about simple commands – Output is of interest ● Playbooks are about idempotence – Output is not really interesting – Change is interesting, and so is a failure
  • 55. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 55/122 Error handling --- - hosts: all any_errors_fatal: True tasks: - name: non-existent command command: downtime - name: uname command: uname Abort everything on first error Non-existent command
  • 56. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 56/122 Failing Playbook ansible-playbook -i hosts.cfg playbook.yml PLAY [all] **************************************************************************************************************** TASK [non-existent command] *********************************************************************************************** Fatal: [192.168.0.5]: FAILED! => {"changed": false, "cmd": "downtime", "msg": "[Errno 2] No such file or directory", "rc": 2} NO MORE HOSTS LEFT ******************************************************************************************************** PLAY RECAP **************************************************************************************************************** 192.168.0.5 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds
  • 58. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 58/122 “Demo” ● The following slides will: – Install a PostgreSQL database – Check connectivity – Create new roles + databases – Allow access (modify pg_hba.conf) – Create a table + index – Run a query
  • 60. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 60/122 Debian (commandline) apt-get install postgresql-13 postgresql-client-13 Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libboost-serialization1.71.0 libgmpxx4ldbl libprotobuf-c1 libsfcgal1 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: postgresql-client-common postgresql-common Suggested packages: postgresql-doc-13 The following NEW packages will be installed: postgresql-13 postgresql-client-13 postgresql-client-common postgresql-common 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 14,5 MB/14,7 MB of archives. After this operation, 45,6 MB of additional disk space will be used.
  • 61. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 61/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
  • 62. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 62/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all Ad-hoc command
  • 63. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 63/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all Ad-hoc command Execute as “root”
  • 64. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 64/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all Ad-hoc command Execute as “root” “apt” module
  • 65. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 65/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all
  • 66. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 66/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all List of packages
  • 67. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 67/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all List of packages Desired Package state
  • 68. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 68/122 Debian (Ansible Ad-hoc) ansible -i 192.168.0.5, -b -m apt -a "name=postgresql-13,postgresql-client-13 state=present" all 127.0.0.1 | CHANGED => { "ansible_facts": { ... }, "cache_update_time": 1592052301, "cache_updated": false, "changed": true, "stderr": "", "stderr_lines": [], "stdout": "…” "stdout_lines": […] ] } Something changed Watch for errors
  • 69. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 69/122 Install PostgreSQL with a Playbook - hosts: all any_errors_fatal: True become: yes tasks: - name: Install PostgreSQL apt: name: - postgresql-13 - postgresql-client-13 - python3-psycopg2 state: present Run as “root” Use Debian package module “apt”
  • 70. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 70/122 Install PostgreSQL with a Playbook ansible-playbook -i 192.168.0.5, playbook.yml TASK [Install PostgreSQL] *************************************************************** Changed: [192.168.0.5] PLAY RECAP **************************************************** 192.168.0.5 : ok=2 changed=1 unreachable=0 failed=0 Playbook run took 0 days, 0 hours, 0 minutes, 24 seconds
  • 71. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 71/122 Re-run the Playbook ansible-playbook -i 192.168.0.5, playbook.yml TASK [Install PostgreSQL] *************************************************************** Changed: [192.168.0.5] PLAY RECAP **************************************************** 192.168.0.5 : ok=2 changed=0 unreachable=0 failed=0 Playbook run took 0 days, 0 hours, 0 minutes, 24 seconds
  • 72. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 72/122 State ● Many Ansible modules have a “state” parameter – Usually defaults to “present” – “present” will install a package, but not upgrade it – “latest” will upgrade, if newer package is available – “absent” will uninstall a package
  • 74. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 74/122 Next: check if PostgreSQL is running ● Ansible provides the “postgresql_ping” module – Login credentials are required (db, username, host) ● This is useful at the beginning of the Playbook: – See if the DB is up and running – Otherwise later commands fail with more obscure errors ● This module runs on the remote host – Hence: the db is on “127.0.0.1” – The Unix Domain Socket is used
  • 75. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 75/122 Check if PostgreSQL is running - name: Ping PostgreSQL postgresql_ping: db: postgres login_unix_socket: "/var/run/postgresql" login_user: postgres become: yes become_user: postgres
  • 76. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 76/122 Check if PostgreSQL is running - name: Ping PostgreSQL postgresql_ping: db: postgres login_unix_socket: "/var/run/postgresql" login_user: postgres become: yes become_user: postgres Runs on “local host” Ansible runs this as user “postgres”
  • 77. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 77/122 Check if PostgreSQL is running TASK [Ping PostgreSQL] ******************************************* Ok: [192.168.0.5] PLAY RECAP ******************************************************* 192.168.0.5 : ok=1 changed=0 unreachable=0
  • 79. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 79/122 Create Roles + Databases ● Manage roles: postgresql_user ● Manage databases: postgresql_db
  • 80. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 80/122 Adding a new role - name: Create role postgresql_user: db: postgres login_user: postgres login_unix_socket: "/var/run/postgresql" Name: "{{ demouser }}" Password: "{{ demopass }}" become: yes become_user: postgres
  • 81. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 81/122 Adding a new role - name: Create role postgresql_user: db: postgres login_user: postgres login_unix_socket: "/var/run/postgresql" Name: "{{ demouser }}" Password: "{{ demopass }}" become: yes become_user: postgres Username and password are stored in variables
  • 82. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 82/122 Notes on creating roles ● The password is stored in a variable – Transmitted in clear text to the remote host – Ansible will prevent logging the password ● Consider pre-encrypted passwords – Creating them is not part of this talk
  • 83. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 83/122 Example: remove a role - name: Drop role postgresql_user: db: postgres login_user: postgres login_unix_socket: "/var/run/postgresql" name: "otheruser" state: absent become: yes become_user: postgres State: “absent” to remove the role
  • 84. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 84/122 Adding a new database - name: Create database postgresql_db: maintenance_db: postgres login_user: postgres login_unix_socket: "/var/run/postgresql" name: "{{ demodb }}" owner: "{{ demouser }}" become: yes become_user: postgres Database name is stored in a variable
  • 85. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 85/122 Adding a new database - name: Create database postgresql_db: maintenance_db: postgres login_user: postgres login_unix_socket: "/var/run/postgresql" name: "{{ demodb }}" owner: "{{ demouser }}" become: yes become_user: postgres New db owner (optional)
  • 86. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 86/122 Notes on databases ● “state=dump” allows taking backups ● “state=restore” allows restoring backups ● Needs a “target=<filename>” for backup/restore
  • 88. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 88/122 Modify pg_hba.conf - name: Allow access for demo user from everywhere postgresql_pg_hba: dest: "/etc/postgresql/13/main/pg_hba.conf" contype: host users: "demouser" source: "0/0" databases: "demodb" method: "md5" notify: - reload postgresql
  • 89. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 89/122 Notes on modifying pg_hba.conf ● The “postgresql_pg_hba” module does not allow much control over the sort order of the entries – Consider “lineinfile” or “blockinfile” or “template” modules ● It must be run as root (on Debian) – The configfiles live in /etc/postgresql
  • 90. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 90/122 Modify pg_hba.conf - name: Allow access for demo user from everywhere postgresql_pg_hba: dest: "/etc/postgresql/13/main/pg_hba.conf" contype: host Users: "{{ demouser }}" source: "0/0" Databases: "{{ demodb }}" method: "md5" notify: - reload postgresql Introduces a “notify”, which requires a “handler”
  • 91. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 91/122 Handler - hosts: all tasks: handlers: - name: reload postgresql service: name: postgresql state: reloaded “handlers” are defined like “tasks” The “name” is free-form Any Ansible module can be used here
  • 92. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 92/122 Handler ● Handler can be called from many places ● Run when the Playbook ends – All “notify”s are queued ● Ideal to reload/restart services at the end – The notify is only run when the Task changed – Playbook doesn’t have to check every single Task
  • 93. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 93/122 pg_hba.conf cat /etc/postgresql/13/main/pg_hba.conf … host demodb demouser 0/0 md5 …
  • 95. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 95/122 Creates tables + indexes ● postgresql_table: manage tables ● postgresql_idx: manage indexes
  • 96. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 96/122 Create a table - name: Create table postgresql_table: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" name: "demotable" columns: - id serial primary key - data text owner: "demouser" become: yes become_user: postgres
  • 97. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 97/122 Create a table - name: Create table postgresql_table: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" name: "demotable" columns: - id serial primary key - data text owner: "demouser" become: yes become_user: postgres Table name and definition
  • 98. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 98/122 Notes on tables ● Will not add/remove new columns – Only the initial set of columns is used when creating the table ● Can specify table and storage parameters ● Can create tables “like” another table ● Can drop/truncate/rename tables ● Can create unlogged tables
  • 99. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 99/122 Create an index - name: Create index on demo table postgresql_idx: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" columns: "data" idxname: "demotable_data_ixd" table: "demotable" become: yes become_user: postgres
  • 100. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 100/122 Create an index - name: Create index on demo table postgresql_idx: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" table: "demotable" columns: "data" idxname: "demotable_data_ixd" become: yes become_user: postgres Index column(s)
  • 101. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 101/122 Create an index - name: Create index on demo table postgresql_idx: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" table: "demotable" columns: "data" idxname: "demotable_data_ixd" become: yes become_user: postgres Index name
  • 102. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 102/122 Notes on Indexes ● The index name is always required (sigh) ● Index can cover multiple columns ● Index can have a different type (“idxtype”) ● Index can be on another tablespace (“tablespace”)
  • 103. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 103/122 Show table demodb=# d demotable Table "public.demotable" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------------------------------------- id | integer | | not null | nextval('demotable_id_seq'::regclass) data | text | | | Indexes: "demotable_pkey" PRIMARY KEY, btree (id) "demotable_data_ixd" btree (data)
  • 105. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 105/122 Run queries ● postgresql_query: run a query against the database
  • 106. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 106/122 Run queries - name: Run INSERT postgresql_query: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" query: "INSERT INTO demotable (data) VALUES ((SELECT random()::TEXT))" become: yes become_user: postgres Query to run
  • 107. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 107/122 Notes on Queries ● Each call of “postgresql_query” will “change” the database – Even if it’s a SELECT query – Use “changed_when: False” – Not idempotent by default ● Queries in Ansible can run in a long-running transaction – Don’t forget to commit/rollback ● Positional arguments and placeholders (prepared queries) are possible ● SQL Code can be in a script
  • 108. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 108/122 Run a SELECT query - name: Run SELECT postgresql_query: login_user: postgres login_unix_socket: "/var/run/postgresql" db: "demodb" query: "SELECT COUNT(*) AS count FROM demotable" become: yes become_user: postgres register: select_result Store the entire result in a variable
  • 109. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 109/122 Show the result - name: debug: msg: "{{ select_result.query_result[0].count }}"
  • 110. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 110/122 Show the result - name: debug: msg: "{{ select_result.query_result[0].count }}" Result variable
  • 111. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 111/122 Show the result - name: debug: msg: "{{ select_result.query_result[0].count }}" Result variable Query results
  • 112. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 112/122 Show the result - name: debug: msg: "{{ select_result.query_result[0].count }}" Result variable Query results The “count” from the query
  • 113. Postgres Vision 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 113/122 Query result TASK [debug] ************************************ ok: [127.0.0.1] => { "msg": "8" } count(*)
  • 115. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 115/122 Running Playbooks ● Playbooks can run from any (Linux) computer – Every developer can run them – However: every developer needs access to all credentials
  • 116. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 116/122 Ansible Tower ● Ansible Tower provides a central place to run Playbooks – Runs can be triggered (as example: GitHub commits) – Runs can be scheduled – Nice web interface ● Commercial product by Red Hat
  • 117. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 117/122 Image copyright: Red Hat
  • 118. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 118/122 Ansible Tower in Open Source: AWX ● More frequent releases – basically: development version for Ansible Tower ● No support from Red Hat ● No cross-upgrade possible
  • 120. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 120/122 Ansible ● Useful tool to manage a large fleet of servers, VMs, services and applications ● Self-documentation ● Idempotence allows re-running of Playbooks until success
  • 121. Postgres Build 2020 Managing PostgreSQL with Ansible Andreas Scherbaum 121/122 Ansible & PostgreSQL ● Many useful modules to manage (almost) any aspect of PostgreSQL databases ● Quick results & small overhead, compared to “shell scripts”