0
私のgitリソースからフェッチされたpostgresql sqlを実行します。 ansible script.Thisでの入力が正常に実行されるスクリプト上記の私の完全なansibleスクリプト実行中のpostgres sqlスクリプトを実行できません
- hosts: "{{ HOST }}"
become: true
become_user: "admin"
become_method: su
gather_facts: true
vars:
app_path: "{{ app_path }}"
app_dir: "{{ app_dir }}"
tasks:
- stat:
path: "{{ app_path }}/{{ app_dir }}"
register: exist
- name: create "{{ app_path }}/{{ app_dir }}" directory
file: dest="{{ app_path }}/{{ app_dir }}" state=directory
when: exist.stat.exists != True
- git:
repo: http://git-url/postgres-demo.git
dest: "{{ app_path }}/{{ app_dir }}"
version: "{{ GIT_TAG }}"
refspec: '+refs/heads/{{ GIT_TAG }}:refs/remotes/origin/{{ GIT_TAG }}'
update: yes
force: true
register: cloned
- name: Execute postgres dump files
shell: "/usr/bin/psql -qAtw -f {{ item }}"
with_fileglob:
- "{{ app_path }}/{{ app_dir }}/{{ scripts_dir }}/*"
register: postgres_sql
become: true
become_user: "postgres"
become_method: su
あるよう 私は最初のgitリポジトリからすべてのスクリプトを取得したいと、私は取って特定のディレクトリからスクリプトを実行したいですしかし、Postgresのステップは衰退以下の私を投げ:私は私のPostgreSQLのDBを確認
[WARNING]: Unable to find '/home/admin/postgres-dev/test' in expected paths.
は、私は、私は、このスクリプトを使用して作成するテーブルを見つけることができません。