diff --git a/ntools/one-m/ansible/group_vars/all b/ntools/one-m/ansible/group_vars/all index 356589dd..1a3ad5b5 100644 --- a/ntools/one-m/ansible/group_vars/all +++ b/ntools/one-m/ansible/group_vars/all @@ -1,4 +1,5 @@ --- -# Variables here are for all host groups +# ansible/group_vars/all +# Variables in this file are for *all* host groups (i.e. all hosts) example_var: 23 \ No newline at end of file diff --git a/ntools/one-m/ansible/one-m-node.yml b/ntools/one-m/ansible/one-m-node.yml index 8d28c781..e6691184 100644 --- a/ntools/one-m/ansible/one-m-node.yml +++ b/ntools/one-m/ansible/one-m-node.yml @@ -1,9 +1,9 @@ --- # This playbook deploys a BigchainDB node in one machine (one-m). -- name: deploy all software and configure it +- name: install + configure + start all software hosts: all - remote_user: root + remote_user: ubuntu roles: - common \ No newline at end of file diff --git a/ntools/one-m/ansible/roles/common/handlers/main.yml b/ntools/one-m/ansible/roles/common/handlers/main.yml index cd79d40f..a7ccf7ff 100644 --- a/ntools/one-m/ansible/roles/common/handlers/main.yml +++ b/ntools/one-m/ansible/roles/common/handlers/main.yml @@ -1,10 +1,9 @@ --- -# This file should be in roles - common - handlers -# Handler to handle common notifications. Handlers are called by other plays. +# ansible/roles/common/handlers/main.yml # See http://docs.ansible.com/playbooks_intro.html for more information about handlers. - name: restart ntp service: name=ntpd state=restarted -- name: restart iptables - service: name=iptables state=restarted \ No newline at end of file +#- name: restart iptables +# service: name=iptables state=restarted \ No newline at end of file diff --git a/ntools/one-m/ansible/roles/common/tasks/main.yml b/ntools/one-m/ansible/roles/common/tasks/main.yml index 8a8786b5..1b543e75 100644 --- a/ntools/one-m/ansible/roles/common/tasks/main.yml +++ b/ntools/one-m/ansible/roles/common/tasks/main.yml @@ -1,18 +1,24 @@ --- # ansible/roles/common/tasks/main.yml +# Note: "become: true" basically means "become root user for this task" i.e. sudo +# See https://docs.ansible.com/ansible/become.html -- name: Do the equivalent of apt-get update +- name: Do the equivalent of "sudo apt-get update" apt: update_cache=yes + become: true - name: Uninstall ntpdate (deprecated) apt: name=ntpdate state=absent + become: true tags: ntp - name: Update all installed packages to their latest versions apt: upgrade=dist + become: true - name: Install ntp apt: name=ntp state=latest update_cache=yes + become: true tags: ntp #- name: Configure ntp file @@ -22,7 +28,8 @@ # notify: restart ntp - name: Start the ntp service - service: name=ntpd state=started enabled=yes + service: name=ntp state=started enabled=yes + become: true tags: ntp #- name: test to see if selinux is running