mirror, mirror on the wall

mirror, mirror on the wall

ansible example

Posted on .

Keep in mind it's possible some of the information to be out-of-date.

root@fhost:~ # ssh-keygen -t rsa
root@fc[1|2]:~ # vi ~/.ssh/authorized_keys
root@[fhost|fc1|fc2]:~ # pkg install py311-ansible
root@fhost:~ # cat /usr/local/etc/ansible/hosts
[freebsd]
fc1 ansible_ssh_host=192.168.178.66
fc2 ansible_ssh_host=192.168.178.67
root@fhost:~ # ansible -m ping freebsd
root@fhost:~ # ansible -m raw -a "pkg install -y slowcgi" freebsd
root@fhost:~ # cat /usr/local/etc/ansible/obhttpd.yml
### Install minimal packages for the webservers

- hosts: freebsd

  tasks:
    - name: Install obhttpd
      pkgng:
        name: obhttpd

    - name: Enable obhttpd
      lineinfile:
        dest: /etc/rc.conf
        backup: yes
        line: obhttpd_enable="YES"
root@fhost:/usr/local/etc/ansible # ansible-playbook obhttpd.yml

About

github

Creative Commons

RSS