Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ansible playbooks for bootstrapping #43

Open
chrisipa opened this issue Jun 11, 2018 · 1 comment
Open

Add support for ansible playbooks for bootstrapping #43

chrisipa opened this issue Jun 11, 2018 · 1 comment
Assignees

Comments

@chrisipa
Copy link
Owner

chrisipa commented Jun 11, 2018

  • Create playbook.yml file:
- hosts: all
  vars:
    jenkins_hostname: 192.168.0.1
  roles:
    - role: geerlingguy.java
      become: yes
    - role: geerlingguy.jenkins
      become: yes
  • Parse playbook.yml for ansible galaxy roles
  • Use ansible-galaxy install to download roles
ansible-galaxy --ignore-certs install geerlingguy.jenkins
  • Execute ansible-playbook:
ansible-playbook -i 192.168.0.1, --extra-vars ansible_ssh_user=my_user --extra-vars ansible_sudo_pass='my_pass' --extra-vars ansible_python_interpreter=/usr/bin/python3 playbook.yml
@chrisipa
Copy link
Owner Author

chrisipa commented Nov 6, 2018

Here's an example for executing ansible for Windows host machines:

ansible -i 192.168.0.1, -e ansible_user='ccc' -e ansible_password='P@ssword' -e ansible_port='5985' -e ansible_connection='winrm' -e ansible_winrm_server_cert_validation=ignore -e validate_certs=false 192.168.0.1 -m win_ping

And here's how to execute an ansible playbook:

ansible-playbook -i 192.168.0.1, -e ansible_user='ccc' -e ansible_password='P@ssword' -e ansible_port='5985' -e ansible_connection='winrm' -e ansible_winrm_server_cert_validation='ignore' -e validate_certs='false' windows.yml

And here's the ansible playbook file to install google chrome:

- hosts: all
  tasks:
  - name: Install google chrome package
    win_chocolatey:
      name: googlechrome
      state: present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant