Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

Running Ansible playbook from Gitlab-CI pipe line

I am trying to run Ansible playbook from my gitlab-pipeline. But I am getting an error "Invalid/incorrect password: Permission denied, please try again."

Here is my GitLab-ci pipeline

before_script:
  - ssh-keyscan <serverip>
  - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
  - chmod 644 ~/.ssh/known_hosts

job1:
    tags:
        - xyz
    script:
        - echo $CI_PROJECT_DIR
        - cd $CI_PROJECT_DIR/scripts
        - ./bashscript.sh
        - echo "Completed"

bashscript.sh contains ansible command "ansible-playbook test.yml" and test.yml

- hosts: all
  gather_facts: yes
  name: checking host
  tasks:
  - name: "Check if the machine is connecting to host"
    shell: echo "Hi"
question from:https://stackoverflow.com/questions/65895594/running-ansible-playbook-from-gitlab-ci-pipe-line

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...