courseworkrep/roles/postgresql/tasks/insert_data.yml

12 lines
398 B
YAML
Raw Normal View History

2024-11-18 20:52:42 +00:00
- name: Insert data into PostgreSQL database
2024-11-13 20:18:44 +00:00
community.postgresql.postgresql_query:
db: '{{ postgres_db }}'
query: |
INSERT INTO contacts (name, phone_number) VALUES
('dima', '123123123'),
('vlad', '8800525252'),
('denis', '77777777')
ON CONFLICT (phone_number) DO NOTHING;
login_user: '{{ postgres_user }}'
login_password: '{{ postgres_password }}'