update Jenkinsfile & backup playbook
This commit is contained in:
parent
e5f1ffb21d
commit
bd630368ab
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -1,14 +1,16 @@
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
SSH_ROOT_PASSWORD = credentials('ssh_root_password') /
|
||||
SSH_ROOT_PASSWORD = credentials('ssh_root_password')
|
||||
PSQL_PASSWORD = credentials('PSQL_pass')
|
||||
ANSIBLE_HOST_KEY_CHECKING = 'False'
|
||||
}
|
||||
parameters {
|
||||
string(name: 'DB_SERVER_IP', defaultValue: '192.168.0.71', description: 'IP-адрес сервера')
|
||||
string(name: 'SSH_USER', defaultValue: 'root', description: 'Имя пользователя для SSH подключения')
|
||||
string(name: 'DB_USER', defaultValue: 'postgres', description: 'Имя пользователя базы данных')
|
||||
string(name: 'DB_NAME', defaultValue: 'mydb', description: 'Имя базы данных')
|
||||
string(name: 'BACKUP_DIR', defaultValue: '/var/backups/postgresql', description: 'Директория для бэкапа')
|
||||
}
|
||||
stages {
|
||||
stage('Clone repository') {
|
||||
@ -71,7 +73,7 @@ pipeline {
|
||||
-e postgres_user=${params.DB_USER} \
|
||||
-e postgres_password=${PSQL_PASSWORD} \
|
||||
-e postgres_db=${params.DB_NAME} \
|
||||
-e backup_dir=/path/to/backup
|
||||
-e backup_dir=${params.BACKUP_DIR}
|
||||
"""
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
become: true
|
||||
|
||||
vars:
|
||||
backup_dir: "{{ backup_dir }}"
|
||||
backup_dir: "{{ backup_dir }}" #work
|
||||
|
||||
tasks:
|
||||
- name: Create backup directory
|
||||
|
Loading…
Reference in New Issue
Block a user