From 4cafc2bd37c2e5dec07790109a4910899407665e Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 6 Jan 2016 21:25:10 +0000 Subject: [PATCH] Fix all tasks to not use old action: statements. --- tasks/cloud_setup_basic.yml | 12 ++++++------ tasks/common_scripts.yml | 2 +- tasks/growroot_cloud.yml | 4 ++-- tasks/growroot_cloud_el7.yml | 2 +- tasks/iptables.yml | 2 +- tasks/postfix_basic.yml | 6 +++--- tasks/serialgetty.yml | 2 +- tasks/virt_instance_create.yml | 4 ++-- tasks/yumrepos.yml | 10 +++++----- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tasks/cloud_setup_basic.yml b/tasks/cloud_setup_basic.yml index 8247b10e11..1e5db4e3d2 100644 --- a/tasks/cloud_setup_basic.yml +++ b/tasks/cloud_setup_basic.yml @@ -17,23 +17,23 @@ - packages - name: put step-tickers in place - action: copy src="{{ files }}/common/step-tickers" dest=/etc/ntp/step-tickers + copy: src="{{ files }}/common/step-tickers" dest=/etc/ntp/step-tickers when: ansible_cmdline.ostree is not defined tags: - ntp - config - name: enable the service - action: service name=ntpd state=running enabled=true + service: name=ntpd state=running enabled=true when: ansible_cmdline.ostree is not defined #- name: edit hostname to be instance name - prefix hostbase var if it exists -# action: shell hostname {{ hostbase }}`curl -s http://169.254.169.254/latest/meta-data/instance-id` +# shell: hostname {{ hostbase }}`curl -s http://169.254.169.254/latest/meta-data/instance-id` # tags: # - config - name: add ansible root key - action: authorized_key user=root key="{{ item }}" + authorized_key: user=root key="{{ item }}" with_file: - /srv/web/infra/ansible/roles/base/files/ansible-pub-key tags: @@ -49,12 +49,12 @@ ignore_errors: true - name: enable ssh_sysadm_login sebool - action: seboolean name=ssh_sysadm_login state=yes persistent=yes + seboolean: name=ssh_sysadm_login state=yes persistent=yes ignore_errors: true # note - kinda should be a handler - but handlers need args - name: restorecon - action: command restorecon -R /root/.ssh + command: restorecon -R /root/.ssh tags: - config diff --git a/tasks/common_scripts.yml b/tasks/common_scripts.yml index 963bcb4fc3..79614e3d67 100644 --- a/tasks/common_scripts.yml +++ b/tasks/common_scripts.yml @@ -5,7 +5,7 @@ # - name: Install common scripts - action: copy src={{ item }} dest=/usr/local/bin/ owner=root group=root mode=0755 + copy: src={{ item }} dest=/usr/local/bin/ owner=root group=root mode=0755 with_fileglob: -"{{ files }}/common-scripts/*" tags: diff --git a/tasks/growroot_cloud.yml b/tasks/growroot_cloud.yml index 156de16b7e..63887369af 100644 --- a/tasks/growroot_cloud.yml +++ b/tasks/growroot_cloud.yml @@ -1,11 +1,11 @@ - name: add infra repo - action: get_url url=http://infrastructure.fedoraproject.org/el/infrastructure.repo dest=/etc/yum.repos.d/ + get_url: url=http://infrastructure.fedoraproject.org/el/infrastructure.repo dest=/etc/yum.repos.d/ when: is_rhel is defined tags: - config - name: install cloud-utils - action: yum name=cloud-utils state=present + yum: name=cloud-utils state=present tags: - packages diff --git a/tasks/growroot_cloud_el7.yml b/tasks/growroot_cloud_el7.yml index 0879d95ecd..b8ae7b13c0 100644 --- a/tasks/growroot_cloud_el7.yml +++ b/tasks/growroot_cloud_el7.yml @@ -1,5 +1,5 @@ - name: add infra repo - action: get_url url=http://infrastructure.fedoraproject.org/el/infrastructure.repo dest=/etc/yum.repos.d/ + get_url: url=http://infrastructure.fedoraproject.org/el/infrastructure.repo dest=/etc/yum.repos.d/ when: is_rhel is defined tags: - config diff --git a/tasks/iptables.yml b/tasks/iptables.yml index a61d8ffda3..cd00909659 100644 --- a/tasks/iptables.yml +++ b/tasks/iptables.yml @@ -22,7 +22,7 @@ - service - name: iptables - action: template src={{ item }} dest=/etc/sysconfig/iptables mode=600 backup=yes + template: src={{ item }} dest=/etc/sysconfig/iptables mode=600 backup=yes with_first_found: - "{{ iptables }}" - "{{ files }}/iptables/iptables.{{ ansible_fqdn }}" diff --git a/tasks/postfix_basic.yml b/tasks/postfix_basic.yml index 96533dbe37..f4fd76b24b 100644 --- a/tasks/postfix_basic.yml +++ b/tasks/postfix_basic.yml @@ -1,11 +1,11 @@ - name: install postfix - action: yum pkg=postfix state=present + yum: pkg=postfix state=present tags: - postfix - packages - name: /etc/postfix/main.cf - action: copy src={{ item }} dest=/etc/postfix/main.cf + copy: src={{ item }} dest=/etc/postfix/main.cf with_first_found: - "{{ postfix_maincf }}" - "{{ roles }}/base/files/postfix/main.cf/main.cf.{{ ansible_fqdn }}" @@ -20,6 +20,6 @@ - config - name: enable postfix to start - action: service name=postfix state=running enabled=true + service: name=postfix state=running enabled=true tags: - service diff --git a/tasks/serialgetty.yml b/tasks/serialgetty.yml index 2de2ba2faa..969bb6e0ce 100644 --- a/tasks/serialgetty.yml +++ b/tasks/serialgetty.yml @@ -1,7 +1,7 @@ --- - name: upstart serial setup - action: copy src="{{ files }}/common/ttyS0.conf" dest=/etc/init/ttyS0.conf + copy: src="{{ files }}/common/ttyS0.conf" dest=/etc/init/ttyS0.conf when: is_rhel is defined tags: - configs diff --git a/tasks/virt_instance_create.yml b/tasks/virt_instance_create.yml index 5eed6da551..94fc84bab7 100644 --- a/tasks/virt_instance_create.yml +++ b/tasks/virt_instance_create.yml @@ -28,12 +28,12 @@ when: inventory_hostname not in result.list_vms - name: start the vm up - action: virt state=running name={{ inventory_hostname }} + virt: state=running name={{ inventory_hostname }} delegate_to: "{{ vmhost }}" when: inventory_hostname not in result.list_vms - name: set it to autostart - action: virt command=autostart name={{ inventory_hostname }} + virt: command=autostart name={{ inventory_hostname }} delegate_to: "{{ vmhost }}" when: inventory_hostname not in result.list_vms diff --git a/tasks/yumrepos.yml b/tasks/yumrepos.yml index 7848db201d..e2be10b05b 100644 --- a/tasks/yumrepos.yml +++ b/tasks/yumrepos.yml @@ -1,6 +1,6 @@ --- - name: put rhel repos on rhel systems - action: copy src="{{ files }}/common/rhel{{ ansible_distribution_major_version }}.repo" dest="/etc/yum.repos.d/rhel{{ ansible_distribution_major_version }}.repo" + copy: src="{{ files }}/common/rhel{{ ansible_distribution_major_version }}.repo" dest="/etc/yum.repos.d/rhel{{ ansible_distribution_major_version }}.repo" when: ansible_distribution == 'RedHat' tags: - config @@ -8,7 +8,7 @@ - yumrepos - name: put epel repos on el systems - action: copy src="{{ files }}/common/epel{{ ansible_distribution_major_version }}.repo" dest="/etc/yum.repos.d/epel{{ ansible_distribution_major_version }}.repo" + copy: src="{{ files }}/common/epel{{ ansible_distribution_major_version }}.repo" dest="/etc/yum.repos.d/epel{{ ansible_distribution_major_version }}.repo" when: ((ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') and use_default_epel) tags: - config @@ -16,7 +16,7 @@ - yumrepos - name: put fedora repos on primary architecture systems - action: copy src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}" + copy: src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}" with_items: - fedora.repo - fedora-updates.repo @@ -28,7 +28,7 @@ - yumrepos - name: put fedora repos on secondary architecture systems - action: copy src="{{ files }}/common/{{ item }}-secondary" dest="/etc/yum.repos.d/{{ item }}" + copy: src="{{ files }}/common/{{ item }}-secondary" dest="/etc/yum.repos.d/{{ item }}" with_items: - fedora.repo - fedora-updates.repo @@ -40,7 +40,7 @@ - yumrepos - name: add infrastructure repo - action: copy src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}" + copy: src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}" with_items: - infrastructure.repo - infrastructure-testing.repo