---
- hosts: 127.0.0.1
connection: local
gather_facts: false
tasks:
- name: test indent
vars:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd path-to-git-repository | |
| if [ `git log --pretty=%H ...refs/heads/master^` == `git ls-remote origin -h refs/heads/master | cut -f1` ]; then | |
| exit 1; | |
| fi | |
| git pull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Исключить все файлы и каталоги | |
| ** | |
| # ... кроме следующих: | |
| !Pipfile | |
| !Pipfile.lock | |
| !main.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: Disable and stoping service if exists | |
| systemd: | |
| service: "{ service name }" | |
| enabled: no | |
| state: stopped | |
| register: result_systemd_stop | |
| failed_when: "result_systemd_stop is failed and 'Could not find the requested service' not in result_systemd_stop.msg" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def commonModule | |
| pipeline { | |
| agent { label 'runner-1' } | |
| stages { | |
| stage('Preparation') { | |
| steps { | |
| script { | |
| commonModule = load 'Jenkinsfile.common' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Получить адрес хоста по его имени в Ansible inventory | |
| host_address=`ansible --inventory ansible/inventories/hosts.yml \ | |
| --module-name debug --args msg="{{ hostvars['host-name'].ansible_host }}" \ | |
| --one-line localhost | sed -E 's/.+"msg":\s"(.+)".+/\1/'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Добавить в пайплайн задание с ручным запуском для тестирование инфраструктуры | |
| # если изменился файл .gitlab-ci.yml или название ветки начинается с infrastructure | |
| test:infrastructure: | |
| stage: test | |
| rules: | |
| - changes: | |
| - .gitlab-ci.yml | |
| when: manual | |
| - if: '$CI_COMMIT_REF_NAME =~ /^infrastructure\/.*$/i' | |
| when: manual |